Element.clientLeft is a read-only instance property that returns the width of an element’s left border in pixels. Learn what it includes and excludes, why display: inline returns 0, and how it pairs with clientTop—with five examples and try-it labs.
01
Kind
Instance property
02
Access
Read-only
03
Type
Integer (px)
04
Measures
Left border
05
Excludes
Padding ยท margin
06
Status
Baseline widely
Fundamentals
Introduction
The client area is the padded content box inside the borders. clientLeft tells you how wide the left border is—the gap from the outer edge of the border to where the padding/content starts.
It does not include left margin or left padding. In rare RTL + overflow cases, a left vertical scrollbar width can be included too.
JavaScript
const el = document.getElementById("contained");
console.log(el.clientLeft); // e.g. 24 for border-left: 24px
💡
Beginner tip
Remember: clientLeft = left border width. Padding and margin are measured by other layout APIs.
Concept
Understanding the Property
MDN: the clientLeft read-only property of the Element interface returns the width of the left border of an element in pixels. It includes the width of the vertical scrollbar if the text direction is right-to-left and overflow causes a left vertical scrollbar. It does not include the left margin or the left padding.
Read-only — change CSS borders, then read again.
Integer pixels — left border thickness.
Inline caveat — display: inline always returns 0.
Baseline — widely available since July 2015 (MDN).
Foundation
📝 Syntax
JavaScript
clientLeft
Value
An integer: the left border width in pixels (plus an RTL left scrollbar when applicable).
Item
Detail
Type
number (integer pixels)
Access
Read-only
Includes
Left border (and RTL left scrollbar if present)
Excludes
Left padding, left margin
⚠️
display: inline
When an element has display: inline, clientLeft returns 0 even if a border is styled. Use a block-level box to measure borders this way.
Pattern
📋 MDN Border Example Shape
MDN uses a box with a 24px black left border. The white client area starts after that border, so clientLeft is 24:
Element.clientLeft is Baseline Widely available (MDN: across browsers since July 2015). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.clientLeft
Read-only integer โ width of the left border in pixels (excludes padding/margin).
BaselineWidely available
Google ChromeSupported
Yes
Microsoft EdgeSupported
Yes
Mozilla FirefoxSupported
Yes
Apple SafariSupported
Yes
OperaSupported
Yes
Internet ExplorerSupported
Yes
clientLeftBaseline
Bottom line: Use clientLeft for left border thickness. Remember inline elements return 0. Pair with clientTop for top border width.
Wrap Up
Conclusion
clientLeft is a simple border measurement: the left border width in pixels. Skip padding and margin, watch out for inline elements, and pair it with clientTop when you need both axes.