Enum ECssPosition
- java.lang.Object
-
- java.lang.Enum<ECssPosition>
-
- de.xima.fc.css.builder.ECssPosition
-
- All Implemented Interfaces:
CssDefaultValue
,Serializable
,Comparable<ECssPosition>
public enum ECssPosition extends Enum<ECssPosition> implements CssDefaultValue
Constants with the pre-defined values for the CSS propertyposition
.The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
- Author:
- XIMA MEDIA GmbH
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABSOLUTE
The element is removed from the normal document flow, and no space is created for the element in the page layout.FIXED
The element is removed from the normal document flow, and no space is created for the element in the page layout.RELATIVE
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values oftop
,right
,bottom
, andleft
.STATIC
The element is positioned according to the normal flow of the document.STICKY
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values oftop
,right
,bottom
, andleft
.
-
Field Summary
-
Fields inherited from interface de.xima.fc.css.builder.CssDefaultValue
INHERIT, INITIAL, REVERT, REVERT_LAYER, UNSET
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toString()
String
value()
static ECssPosition
valueOf(String name)
Returns the enum constant of this type with the specified name.static ECssPosition[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ABSOLUTE
public static final ECssPosition ABSOLUTE
The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. Its final position is determined by the values oftop
,right
,bottom
, andleft
.This value creates a new stacking context when the value of
z-index
is notauto
. The margins of absolutely positioned boxes do not collapse with other margins.
-
FIXED
public static final ECssPosition FIXED
The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other thannone
(see the CSS Transforms Spec), or the will-change property is set totransform
, in which case that ancestor behaves as the containing block. (Note that there are browser inconsistencies withperspective
andfilter
contributing to containing block formation.) Its final position is determined by the values oftop
,right
,bottom
, andleft
.This value always creates a new stacking context. In printed documents, the element is placed in the same position on every page.
-
RELATIVE
public static final ECssPosition RELATIVE
The element is positioned according to the normal flow of the document, and then offset relative to itself based on the values oftop
,right
,bottom
, andleft
. The offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position werestatic
.This value creates a new stacking context when the value of
z-index
is notauto
. Its effect ontable-*-group
,table-row
,table-column
,table-cell
, andtable-caption
elements is undefined.
-
STATIC
public static final ECssPosition STATIC
The element is positioned according to the normal flow of the document. Thetop
,right
,bottom
,left
, andz-index
properties have no effect. This is the default value.
-
STICKY
public static final ECssPosition STICKY
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor and containing block (nearest block-level ancestor), including table-related elements, based on the values oftop
,right
,bottom
, andleft
. The offset does not affect the position of any other elements.This value always creates a new stacking context. Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when
overflow
ishidden
,scroll
,auto
, oroverlay
), even if that ancestor isn't the nearest actually scrolling ancestor.
-
-
Method Detail
-
values
public static ECssPosition[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ECssPosition c : ECssPosition.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ECssPosition valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
public String toString()
- Overrides:
toString
in classEnum<ECssPosition>
-
value
public String value()
- Returns:
- The string value of this property that can be used when creating CSS strings.
-
-