Package com.oorian.css.units
Class Rem
java.lang.Object
com.oorian.css.units.Units
com.oorian.css.units.Rem
CSS rem (root em) unit value.
The rem unit is relative to the font-size of the root element (typically the
<html> element). Unlike em units, rem units are not affected by the font-size
of parent elements, making them more predictable for consistent sizing throughout
a document.
Usage:
Units size = new Rem(1.5f);
element.setFontSize(new Rem(1));
element.setPadding(new Rem(2));
- 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 rem value.
-
Constructor Details
-
Rem
public Rem(float value) Constructs a Rem unit with the specified value.- Parameters:
value- the rem value
-
-
Method Details
-
sizeToString
Returns the CSS string representation of this rem value.- Specified by:
sizeToStringin classUnits- Returns:
- the CSS value string (e.g., "1.5rem")
-