Package com.oorian.css.units
Class Px
java.lang.Object
com.oorian.css.units.Units
com.oorian.css.units.Px
CSS pixel (px) unit value.
Pixels are absolute-length units that represent a single dot on the screen. The actual size of a pixel is relative to the viewing device - on high-DPI displays, one CSS pixel may consist of multiple device pixels.
Usage:
Units size = new Px(16);
element.setWidth(new Px(300));
element.setFontSize(new Px(14));
- 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 pixel value.
-
Constructor Details
-
Px
public Px(float value) Constructs a Px unit with the specified value.- Parameters:
value- the pixel value
-
-
Method Details
-
sizeToString
Returns the CSS string representation of this pixel value.- Specified by:
sizeToStringin classUnits- Returns:
- the CSS value string (e.g., "16px")
-