Class Ex


public class Ex extends Units
CSS ex (x-height) unit value.

The ex unit is equal to the x-height of the element's font, which is typically the height of the lowercase letter "x". This unit is font-dependent and useful for vertical spacing that should scale with the font's characteristics.

Usage:


 Units size = new Ex(2);
 element.setLineHeight(new Ex(3));
 element.setPadding(new Ex(1));
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Ex

      public Ex(float value)
      Constructs an Ex unit with the specified value.
      Parameters:
      value - the ex value (x-height of font)
  • Method Details

    • sizeToString

      public String sizeToString()
      Returns the CSS string representation of this ex value.
      Specified by:
      sizeToString in class Units
      Returns:
      the CSS value string (e.g., "2ex")