CSS leftProperty
Example
Set the image's left edge at a position 5 pixels to the right of its containing element's left edge:
img
{
position:absolute;
left:5px;
}
{
position:absolute;
left:5px;
}
Try it Yourself »
Attribute Definition and Usage Instructions
The left property specifies the left edge of an element. This property defines the offset between the left margin edge of a positioned element and the left edge of its containing block.
If the value of the "position" property is "static", setting the "left" property has no effect.
Note: If "position:static", the left property has no effect.
| Default value: | auto |
|---|---|
| Inherited: | no |
| version: | CSS2 |
| JavaScript Syntax: | object.style.left="50px" |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| left | 1.0 | 5.5 | 1.0 | 1.0 | 5.0 |
Property value
| Value | Description |
|---|---|
| auto | Default value. The position of the left edge is calculated by the browser. |
| % | Sets the left position as a percentage of the containing element. Negative values are allowed. |
| length | Sets the left position of the element using units such as px, cm, etc. Negative values are allowed. |
| inherit | Specifies that the value of the left property should be inherited from the parent element. |
Related Articles
CSS Tutorial:CSS Positioning
other extensions