Back to CSS

CSS Tutorial

Positioning

Control element placement with static, relative, absolute, fixed, and sticky.

Positioning is useful for sticky headers, overlays, badges, and anchored elements.

Use positioning carefully so content does not overlap unexpectedly.

css
.sidebar {
  position: sticky;
  top: 96px;
}