CSS top Property Reference

The CSS top property is a standard property in CSS Anchor Positioning. Review its formal syntax, computed behavior, and practical declarations.

CSS top Property Reference

The CSS top property is a standard property in CSS Anchor Positioning. Review its formal syntax, computed behavior, and practical declarations.

Updated 2026-08-12

top overview

The CSS top property is a standard property in CSS Anchor Positioning. Review its formal syntax, computed behavior, and practical declarations.

The property is not inherited by default. Use an explicit global keyword when inheritance is intended.

Syntax and formal definition

top formal syntax
FieldValue
Formal syntaxauto | <length-percentage> | <anchor()> | <anchor-size()>
Initial valueauto
Applies topositionedElements
InheritedNo
PercentagesreferToContainingBlockHeight
Computed valuelengthAbsolutePercentageAsSpecifiedOtherwiseAuto
Animation typelpc
Mediavisual
Specification groupCSS Anchor Positioning
StatusStandard

Practical examples

These declarations demonstrate valid ways to set top. The initial and inherit global keywords remain available even when a property-specific value is preferable.

top live example
CSS .reset-example { top: initial; } .inherit-example { top: inherit; } @supports (top: initial) { .supported { top: initial; } }

Description

The CSS top property is a standard property in CSS Anchor Positioning. Review its formal syntax, computed behavior, and practical declarations.

References

  1. MDN: top
  2. MDN: CSS Properties Reference

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies