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.