The left property controls how far an element sits from the left edge of its containing block. It is one of the core CSS positioning tools used with position: absolute, relative, fixed, and sticky.
01
Horizontal Offset
Move elements left or right.
02
Syntax
Length, percentage, auto.
03
Position Pair
Works with position values.
04
Containing Block
Know your reference box.
05
Percentages
Relative to container width.
06
Logical Alt
inset-inline-start for RTL.
Fundamentals
Definition and Usage
The left CSS property sets the horizontal offset of a positioned element. It defines the distance between the left edge of the element’s margin box and the left edge of its containing block.
This property moves an element to the right when you use a positive value, or further left when you use a negative value. It is commonly used with position values such as absolute, relative, fixed, and sticky.
💡
Beginner Tip
Always set a non-static position before using left. Without it, the property has no visible effect on layout.
Foundation
📝 Syntax
The syntax for the left property is straightforward:
syntax.css
selector{left:value;}
Basic Example
left.css
.box{position:absolute;left:50px;}
Syntax Rules
The value can be a length, a percentage, or the keyword auto.
Positive values push the element away from the left edge.
Negative values can move the element partially outside the container.
The property is not inherited.
It only applies when position is not static.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
Positioned elements (relative, absolute, fixed, sticky)
Inherited
No
Animatable
Yes, as a length or percentage
Common use
Absolute layouts, overlays, sidebars, and nudged relative elements
Reference
💎 Property Values
The default value of left is auto. That means the browser calculates placement based on normal layout rules and other positioning properties.
Value
Example
Meaning
Length
left: 20px;
Fixed distance from the left edge in px, em, rem, etc.
Percentage
left: 50%;
Distance as a percentage of the containing block’s width
auto
left: auto;
Lets the browser determine the offset (default behavior)
inherit
left: inherit;
Inherits the value from the parent element
initial
left: initial;
Resets the property to its initial value (auto)
left: 50px;left: 50%;left: 1rem;left: auto;
Scope
Requires Positioned Elements
left controls horizontal offset from the containing block’s left edge. It works with these position values:
position: absolute — offsets relative to the nearest positioned ancestor.
position: fixed — offsets relative to the viewport.
position: sticky — offsets apply when the element becomes stuck.
position: relative — shifts the element from where it would normally appear.
🛠
Logical Alternative
For international layouts, consider inset-inline-start. In horizontal LTR pages it behaves like left, but it adapts in RTL writing mode.
Preview
👀 Live Preview
An absolutely positioned box with left: 50px inside a dashed container:
Hands-On
Examples Gallery
Position a box with pixel and percentage values, nudge a relatively positioned element, and pin fixed UI to the viewport.
🔢 Absolute Positioning
Start with the reference example — place a box 50 pixels from the left edge of its container.
Example 1 — Absolute left: 50px
Position a box 50 pixels from the left edge of a relatively positioned container.
The .box element is absolutely positioned 50 pixels from the left edge of the .container, which acts as the containing block because it has position: relative.
Example 2 — Percentage Offset
Use a percentage to place an element halfway across its container.
Set position to absolute, fixed, sticky, or relative.
Position
2
left sets horizontal offset
The browser measures distance from the containing block’s left edge to the element’s margin edge.
CSS rule
3
Browser places the box
The element is drawn at the calculated horizontal position inside its containing block or viewport.
Layout
=
←
Precise horizontal placement
Sidebars, badges, overlays, and nudged elements land exactly where you need them.
Compatibility
🖥 Browser Compatibility
The left property is widely supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It has been part of CSS since early positioning specifications.
✓ Universal · All browsers
Core positioning in every browser
left is a foundational CSS property. You can rely on it in any web project without polyfills.
99%Global browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Legacy & Chromium
Full support
OperaAll versions · Modern & legacy
Full support
left property99% supported
Bottom line: Safe to use everywhere. Still test your layout in the browsers your audience uses for consistent visual results.
Wrap Up
🎉 Conclusion
The left property is a fundamental tool in CSS for positioning elements horizontally within their containers. It offers flexibility in design and can be used to create a wide variety of layouts, from simple nudges to fixed sidebars and centered overlays.
Whether you’re building a simple static webpage or a complex dynamic interface, understanding how to use left effectively will be valuable in your CSS toolkit. Experiment with different values and positioning contexts to see how this property helps you achieve your design goals.
Use percentages for responsive horizontal placement
Combine with top, right, or bottom for full control
Consider inset-inline-start for RTL-friendly layouts
❌ Don’t
Apply left without setting position
Confuse left with margin-left or padding-left
Cover important controls with fixed overlays
Forget containing block context for absolute elements
Hard-code physical left values when logical properties fit better
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about left
Use these points when positioning elements with CSS.
5
Core concepts
←01
Horizontal Offset
Distance from left edge.
Purpose
auto02
Default auto
Browser decides.
Default
%03
Percentages
Of container width.
Values
abs04
Positioned
Required.
Pattern
RTL05
Logical alt
inset-inline-start.
i18n
❓ Frequently Asked Questions
The left property sets the horizontal offset of a positioned element from the left edge of its containing block.
The default value is auto, which lets the browser determine placement based on other positioning rules and normal document flow.
No. left only affects elements with position set to relative, absolute, fixed, or sticky.
Yes. A percentage is calculated relative to the width of the containing block. For example, left: 50% moves the element halfway across its container.
In horizontal LTR writing mode they often match, but inset-inline-start is a logical property that adapts when text direction changes. left always refers to the physical left edge.