Package com.oorian.css.units
Class Vh
java.lang.Object
com.oorian.css.units.Units
com.oorian.css.units.Vh
CSS vh (viewport height) unit value.
The vh unit is equal to 1% of the height of the viewport. For example, if the viewport is 900px tall, 1vh equals 9px. Viewport units are useful for creating full-screen layouts that adapt to different screen sizes.
Usage:
Units size = new Vh(100); // Full viewport height
element.setHeight(new Vh(50)); // Half viewport height
element.setMinHeight(new Vh(80));
- 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 vh value.
-
Constructor Details
-
Vh
public Vh(float value) Constructs a Vh unit with the specified value.- Parameters:
value- the vh value (percentage of viewport height)
-
-
Method Details
-
sizeToString
Returns the CSS string representation of this vh value.- Specified by:
sizeToStringin classUnits- Returns:
- the CSS value string (e.g., "50vh")
-