Javascript Reference
Categories: STYLE

javascript STYLE top

@July 12, 2008, 5:43 a.m.
top Firefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 2  
Read/Write  

For positionable elements, defines the position of the top edge of an STYLE element's box (content plus top padding, border, and/or margin) relative to the top edge of the next outermost block content container. When the element is relative-positioned, the offset is based on the top edge of the inline location of where the element would normally appear in the content.

 

For calculations on this value, use parseFloat( ) on the returned value; or, in IE, retrieve the pixelTop or posTop properties, which return genuine numeric values.

 
Example
 
document.getElementById("blockD2").style.top = "40px";
 
Value

String consisting of a numeric value and length unit measure, a percentage, or auto.

 
Default

auto


Powered by Linode.