mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 23:49:06 +08:00
fix(curriculum) : Correct wording for Sticky positioning (#64515)
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ float: right;
|
||||
}
|
||||
```
|
||||
|
||||
- **Sticky Positioning**: This type of positioning will act as a relative positioned element as you scroll down the page. If you specify a `top`, `left`, `right` or `bottom` property, then the element will stop acting like a relatively positioned element and start behaving like a fixed position element.
|
||||
- **Sticky Positioning**: This type of positioning will act as a hybrid between relative and fixed positioning. Initially, the element behaves as though it's positioned relatively, staying within the flow of the document. However, once the user scrolls the element past a certain point, it "sticks" to the viewport (usually the top) and behaves as though it is fixed. This is great for creating elements like sticky navigation bars, which only become fixed once the user scrolls to a certain position.
|
||||
|
||||
```css
|
||||
.positioned {
|
||||
|
||||
@@ -470,7 +470,7 @@ Using placeholder text is not great for accessibility. Too often, users confuse
|
||||
## Fixed and Sticky Positioning
|
||||
|
||||
- **Fixed Positioning**: When an element is positioned with `position: fixed`, it is removed from the normal document flow and placed relative to the viewport, meaning it stays in the same position even when the user scrolls. This is often used for elements like headers or navigation bars that need to remain visible at all times.
|
||||
- **Sticky Positioning**: This type of positioning will act as a relative positioned element as you scroll down the page. If you specify a `top`, `left`, `right` or `bottom` property, then the element will stop acting like a relatively positioned element and start behaving like a fixed position element.
|
||||
- **Sticky Positioning**: This type of positioning will act as a hybrid between relative and fixed positioning. Initially, the element behaves as though it's positioned relatively, staying within the flow of the document. However, once the user scrolls the element past a certain point, it "sticks" to the viewport (usually the top) and behaves as though it is fixed. This is great for creating elements like sticky navigation bars, which only become fixed once the user scrolls to a certain position.
|
||||
|
||||
## Working With the `z-index` Property
|
||||
|
||||
|
||||
Reference in New Issue
Block a user