Positioning gives precise control over where elements sit on the screen relative to their parent or viewport.
1. The 5 Positioning Models
⊞Code Example
.parent-card {
position: relative; /* Anchor for absolute children */
padding: 20px;
}
.close-button {
position: absolute;
top: 12px;
right: 12px;
}
.sticky-header {
position: sticky;
top: 0;
z-index: 50;
}
