Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Element.clientWidth

Element.clientWidth 属性表示元素的内部宽度,以像素计。该属性包括内边距,但不包括垂直滚动条(如果有的话)、边框和外边距。

该属性值会被四舍五入为一个整数。如果你需要一个小数值,可使用 element.getBoundingClientRect()

语法

var intElemClientWidth = element.clientWidth;
 

intElemClientWidth 是一个整数,表示元素的 clientWidthclientWidth 是只读的。

 

示例

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.

Image:BirmanCat.jpgAll Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.

Cat image and text coming from www.best-cat-art.com

padding-bottom

LeftTopRightBottommargin-topmargin-bottomborder-topborder-bottom

 

规范

备注

clientWidth 首次出现于 MS IE DHTML 对象模型中。

相关链接

文档标签和贡献者

 此页面的贡献者: teoli, AlexChao, ziyunfei, Mgjbot, Dewang
 最后编辑者: AlexChao,