CSS left Property
Description
The left property controls the horizontal offset of an element when that element participates in CSS positioning. It shifts the element’s box along the inline (left–right) axis relative to the reference established by its positioning context, so it only has an effect when the element is not using the default static positioning—see position. Conceptually, think of left as telling the browser where, horizontally, to place the positioned box within its containing block or relative to its normal position.
How left affects layout depends on the positioning scheme in use. For example, with relative positioning the element is visually offset but its original space in the flow is preserved; with absolute or fixed positioning the element is taken out of the normal flow and placed with respect to its containing block or the viewport. The property has a direct vertical counterpart, top, which performs the analogous role along the block (vertical) axis.
Practical considerations include how left interacts with other layout features and how it is used in responsive and animated designs. There is a shorthand that can set multiple inset sides at once—see inset—and transforms and compositing affect how movement is rendered; using transform (for example for animations) is often more performant than animating positional offsets. Finally, remember that the effect of left depends on the element’s positioning context and stacking/containment rules, so its visual outcome is best understood in the context of the surrounding positioned ancestors.
Definition
- Initial value
- auto
- Applies to
- Positioned elements
- Inherited
- No
- Computed value
- If specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto'
- Animatable
- Yes
- JavaScript syntax
- object.style.left
Interactive Demo
Syntax
left: auto | <length> | <percentage>
Values
- <length>Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).
- <percentage>Integer, followed by a percent sign (%). The value is a percentage of the height of the parent object.
- autoDefault position, according to the regular HTML layout of the page.
Example
Browser Support
The following information will show you the current browser support for the CSS left property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
