Top

The   property is used in CSS and certain HTML elements. It specifies part of the position of positioned elements. For absolutely positioned elements (those with  or  ), it specifies the distance between the top margin edge of the element and the top edge of its containing block. For relatively positioned elements (those with ), it specifies the amount the element is moved below its normal position.

Values

 * - A length which can be negative, zero, or positive. Ex.,  , etc.
 * - A percentage of the containing block's height.
 * - For absolutely positioned elements, it positions the element based on the  property and treats   as a height based on the content. For relatively positioned elements, the offset of the element from its original position is based on the   property, or if   is also , it does not offset it at all.
 * - Inherits the computed value from its parent element (which may not be its containing block). This computed value is then handled like it was a, a  , or.

HTML example:

TEXT

CSS example:

div { position:fixed; top:20px; }