Top

Syntax

Class
Properties
top-{value}
top: {value};

Parameters

value
<length-percentage default-unit=1px>
value
auto

 

Examples

<div class="t1 w-160 h-160 relative bg-c-white shadow-4"> <div class="t1 w-32 h-32 bg-c-blue absolute top-0"></div> </div>

Specification test cases

The test cases below are imported from the Turbo CSS specification. They have been executed upon loading this page.
Set top to 1px without specifying the px unit.
t1 top-1
.t1.top-1 { top: 1px; }
Set top to 1px with specifying the px unit.
t1 top-1px
.t1.top-1px { top: 1px; }
Set top to 50% of its container.
t1 top-50%
.t1.top-50\% { top: 50%; }
Set top to auto.
t1 top-auto
.t1.top-auto { top: auto; }