pub enum Position {
Relative,
Absolute,
Static,
Fixed,
}Expand description
Defines the positioning method for an element.
This enum determines how an element is positioned within its containing element.
Variants§
Relative
The element is positioned according to the normal flow of the document. Offsets (top, right, bottom, left) have no effect.
Absolute
The element is removed from the normal document flow and positioned relative to its nearest positioned ancestor. Offsets (top, right, bottom, left) specify the distance from the ancestor.
Static
The element is laid out in the normal flow and is not a containing block. Offsets (top, right, bottom, left) have no effect.
Fixed
The element is removed from the normal document flow and positioned relative to the viewport (root).
Implementations§
Source§impl Position
impl Position
Sourcepub const fn is_positioned(self) -> bool
pub const fn is_positioned(self) -> bool
A positioned element (anything but static): establishes a containing
block for absolutely-positioned descendants and honors z-index.
Sourcepub const fn is_out_of_flow(self) -> bool
pub const fn is_out_of_flow(self) -> bool
Removed from normal flow.
Trait Implementations§
impl Copy for Position
Source§impl<'i> FromCss<'i> for Position
impl<'i> FromCss<'i> for Position
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parser instance.