Element.clientTop

The width of the top border of an element in pixels. It does not include the top margin or padding. clientTop is read-only.

Gecko-based applications support clientTop starting with Gecko 1.9 (Firefox 3, implemented in bug 111207). This property is not supported in Firefox 2 and earlier.

Syntax

JavaScript
var top = <var>element</var>.clientTop;

Example

padding-top

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

padding-bottom

Left Top Right Bottom margin-top margin-bottom border-top border-bottom

Notes

clientTop was first introduced in the MS IE DHTML object model.

Specifications

Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'clientTop' in that specification.
Working Draft  

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/element/clienttop

API CSSOM View NeedsAgnostify NeedsCompatTable NeedsMarkupWork Property Reference Référence