top
Determines the vertical distance between the top edge of a positioned element and the top edge of its containing block.
It is documented as part of the CSS Anchor Positioning, CSS Positioned Layout specification.
Syntax
/* Usage Example */
.box {
position: absolute;
top: 20px;
/* shifts the element 20px down from the top edge */
}
/* Syntax */
top: auto;
top: anchor;
top: anchor-size;
/* Global values */
top: inherit;
top: initial;
top: revert;
top: revert-layer;
top: unset;
top Browser support
Widely available
Since
2015 96% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
1+
1+
1+
12+