13. Positioning
इस लेख का अनुवाद अपने आप होगा। अभी अंग्रेज़ी में दिखाया जा रहा है।
position: relative keeps an element in the flow but lets you offset it. position: absolute places it relative to the nearest positioned ancestor. position: sticky keeps an element on screen while you scroll.
Top, right, bottom and left set the offsets.
उदाहरण देखें
.badge {
position: absolute;
top: 8px;
right: 8px;
}
✍️ अब आपकी बारी
Make .header stick to the top of the screen while scrolling.