Package com.oorian.css
Enum Class Position
- All Implemented Interfaces:
Serializable,Comparable<Position>,Constable
CSS position property values for element positioning method.
The position property specifies how an element is positioned in the document. Once positioned, the element can be adjusted using top, right, bottom, and left properties.
Position Types:
STATIC- Normal document flow (default)RELATIVE- Offset from normal positionABSOLUTE- Positioned relative to nearest positioned ancestorFIXED- Positioned relative to viewportSTICKY- Hybrid of relative and fixed
Usage:
element.setPosition(Position.RELATIVE);
element.setPosition(Position.ABSOLUTE);
element.setPosition(Position.STICKY);
- Since:
- 2012
- Version:
- 1.1
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPositioned relative to the nearest positioned ancestor.Positioned relative to the viewport.Inherits the position value from the parent element.Sets the position to the default value (static).Positioned relative to its normal position.Rolls back to the value defined by a previous cascade origin.Rolls back to the value defined in the previous cascade layer.Normal document flow positioning (default).Hybrid of relative and fixed positioning.Resets the property to its inherited value or initial value. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the CSS value string.toString()Returns the CSS value string.static PositionReturns the enum constant of this class with the specified name.static Position[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INHERIT
Inherits the position value from the parent element. -
INITIAL
Sets the position to the default value (static). -
UNSET
Resets the property to its inherited value or initial value. -
REVERT
Rolls back to the value defined by a previous cascade origin. -
REVERT_LAYER
Rolls back to the value defined in the previous cascade layer. -
STATIC
Normal document flow positioning (default). The element is positioned according to the normal flow. Top, right, bottom, left, and z-index have no effect. -
RELATIVE
Positioned relative to its normal position. The element remains in normal flow, but can be offset using top, right, bottom, and left. Other elements are not affected. -
ABSOLUTE
Positioned relative to the nearest positioned ancestor. The element is removed from normal flow. If no positioned ancestor exists, it is positioned relative to the initial containing block. -
FIXED
Positioned relative to the viewport. The element is removed from normal flow and stays in place when the page is scrolled. Useful for persistent headers or footers. -
STICKY
Hybrid of relative and fixed positioning. The element is treated as relative until it crosses a specified threshold (using top, right, bottom, or left), then it becomes fixed. Commonly used for sticky navigation headers.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
Returns the CSS value string.- Returns:
- the CSS value
-
toString
Returns the CSS value string.
-