7 - Layout and Positioning in CSS
7 - Layout and Positioning in CSS
Display Property:
`block`: Generates a block-level element that takes up the full width available and
new line and only occupies the space necessary for its content.
Position Property:
The `position` property specifies how an element is positioned within its containing
element.
`static`: The default position value, where elements follow the normal flow of the
document.
5 layout and positioning in CSS
`relative`: Positions an element relative to its normal position, allowing adjustment using
`absolute`: Positions an element relative to its nearest positioned ancestor or the initial
containing block.
`fixed`: Positions an element relative to the viewport, meaning it stays fixed even when the
page is scrolled.
6 layout and positioning in CSS
Float Property:
- The `float` property specifies whether an element should be floated to the left or
- Floated elements are taken out of the normal flow of the document.
Clear Property:
Flexbox Layout:
Questions?