The top
property is used with position to set the top placement of an element. It only has an effect on positioned elements, which are elements with the position
property set to anything other than static
. For example: relative
, absolute
, fixed
, or sticky
.
div {
top: <length> || <percentage> || auto || inherit;
}