English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM clientLeft property

HTML DOM Element Object

clientLeftThe read-only property returns the width of the left border of the element, in pixels.

The clientLeft property does not include the left margin or padding.

UsingclientTopThe property returns the width of the element's top border.

Note:When the element hasdisplay: inlineWhen the element's border is set to0.

Syntax:

element.clientLeft
var elem = document.querySelector("div");
var txt = "Border Top Width: " + elem.clientTop + "px<br>";
txt += "Border Left Width: " + elem.clientLeft + "px";
Test to see‹/›

Browser Compatibility

All browsers fully support the clientLeft property:

Property
clientLeftYesYesYesYesYes

Technical Details

Return Value:A number representing the width of the element's left border, in pixels

Related References

HTML DOM Reference:HTML DOM clientTop Property

HTML DOM Element Object