Package com.oorian.css.units
Class Ex
java.lang.Object
com.oorian.css.units.Units
com.oorian.css.units.Ex
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the CSS string representation of this ex value.
-
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
Returns the CSS string representation of this ex value.- Specified by:
sizeToStringin classUnits- Returns:
- the CSS value string (e.g., "2ex")
-