left
Moves a positioned element in from the left. With absolute or fixed it measures from the left edge of the containing block, and with relative it shifts the element from where it would normally sit.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyHas a modern alternativeIt still works everywhere, as it has since July 2015, and there's a newer way for most uses.
anchor()Baseline Jan 2026anchor-size()Baseline Jan 2026
Use inset-inline-start. It follows the writing direction, so the same CSS works in right-to-left languages.
When the old way is still right: Keep physical properties when the direction belongs to the screen, not the text, such as a shadow offset or something pinned to the right edge in every language.
The CSS audit finds physical left and right in your code.Check your CSS →
Quick facts
- Initial value
auto- Inherited
- No
- Applies to
- positioned elements
- Animation type
- lpc
Quick example
.tooltip {
position: absolute;
left: 50%;
translate: -50% 0;
}Values
auto<length><percentage>anchor()anchor-size()Examples
Stretch between two sides
.banner {
position: absolute;
left: 1rem;
right: 1rem;
}When width is auto, setting both left and right stretches the box across the space between them.
Percentages use the containing block
.progress-marker {
position: absolute;
left: 25%;
}A percentage is measured against the containing block, so left: 25% puts the element a quarter of the way across.
Line up with an anchor
.button {
anchor-name: --button;
}
.menu {
position: absolute;
position-anchor: --button;
left: anchor(left);
top: anchor(bottom);
}anchor(left) resolves to the left edge of the anchor element, so the menu's left edge lines up with the button.
Common pitfalls
- Nothing happens on static elementsleft only applies to positioned elements. With the default position: static it is ignored.
- left and right together on relativeIf a relatively positioned element sets both, one of them is ignored. In left-to-right text, right is the one dropped.
- left does not follow text directionleft is always the physical left side. For layouts that should flip in right-to-left languages, use inset-inline-start instead.