HTML/CSSIntermediate#css#position

Explain the CSS position property values.

static is the default flow. relative offsets an element from its normal position without affecting siblings. absolute removes it from flow and positions relative to the nearest positioned ancestor. fixed positions relative to the viewport, ignoring scroll. sticky toggles between relative and fixed based on scroll position within its container.

Example
.tooltip {
  position: absolute;
  top: 100%;
  left: 0;
}
.navbar { position: sticky; top: 0; }

Related Questions

1
HTML/CSSIntermediate#css#position

How does position: sticky work?

Open
2
HTML/CSSIntermediate#css#float

What is the CSS float property used for and what problems does it cause?

Open
3
HTML/CSSAdvanced#css#float

How do you clear floats without adding extra markup?

Open