leftNN 4 IE 4 CSS 2

Inherited: No

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

 
CSS Syntax
 
left: 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 width of the next outermost container. The setting of auto lets the browser determine the left offset of the element box within the containing box by virtue of normal element flow. Navigator tends to push up against the left edge of the containing box, whereas Internet Explorer renders a bit of margin.

 
Initial Value

auto

 
Example
 
h1 {position: relative; left: 2em}
#logo {position: absolute; left: 80px; top: 30px}
 
Applies To

Positioned elements.

 
Object Model Reference
 
[window.]document.getElementById("elementID").style.left