top | NN 4 IE 4 CSS 2
| Inherited: No
For positioned elements, this defines the position of the top edge of an element box (content plus top padding, border, and/or margin) relative to the top edge of the next outermost block content container.
CSS Syntax
    top: length | percentage | auto
Value
See the discussion about length values at the beginning of this chapter. Negative lengths may be allowed in some contexts, but be sure to test the results on all browsers. You may also specify a percentage value, which is calculated based on the height of the next outermost container. The setting of auto lets the browser determine the top offset of the element box on its naturally flowing offset within the containing box.
Initial Value
auto
Example
    h1 {position:relative; top:2em}
    #logo {position:absolute; left:80px; top:30px}
Applies To
Positioned elements.
Object Model Reference
    [window.]document.getElementById("elementID").style.top