On this page
  1. Positioning & Stacking
  2. Contents
  3. position Values & inset
  4. Stacking Contexts & isolation

Positioning & Stacking

Prev: Display & Layout | Up: properties | Next: Typography & Color
Rel: Box Model & Formatting Contexts, Interactive & Scripting
Ref: MDN Web Docs — position
Tags: #public #web #css #properties #positioning


Contents


position Values & inset

.sticky-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
}

Stacking Contexts & isolation

z-index only compares elements within the same stacking context. Create a clean local stacking context without arbitrary z-index hacks using isolation: isolate; so internal overlays never leak outside a component.

Linked from

Related notes