返回元素内部的高度(单位像素),包含内边距,但不包括水平滚动条、边框和外边距。
clientHeight
可以通过 CSS height
+ CSS padding
- 水平滚动条高度 (如果存在)来计算.
语法
var h = element.clientHeight;
返回整数 h
,表示 element
的 clientHeight
(单位像素)。
clientHeight
是只读的.
示例
padding-top
Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.
All Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.
Cat image and text coming from https://www.best-cat-art.com/
padding-bottom
规范
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module clientheight |
Working Draft |
备注
clientHeight
首次出现于 IE 的 DHTML 对象模型中。