On this page
  1. position
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

position

Prev: positioning | Up: positioning | Next: `inset`
Rel: positioning, Positioning & Stacking Guide
Ref: MDN Web Docs — position
Tags: #public #web #css #properties #positioning #tier/core


Syntax & Overview

position: static | relative | absolute | fixed | sticky;

Selects positioning scheme and whether inset/z-index apply.

Notes & Best Practices

Example

.sticky-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

Linked from

Related notes