Easy Tutorial
❮ Sel Enabled Pr Tab Empty Cells ❯

CSS left Property

Example

Set the left edge of an image 5 pixels to the right of the left edge of its containing element:


Property Definition and Usage

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 "position" property is set to "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 Values

Value Description
auto Default value. The browser calculates the left edge position.
% Sets the left position in percent of the containing element. Negative values are allowed.
length Sets the left position using 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

❮ Sel Enabled Pr Tab Empty Cells ❯