clientWidth
The Element.clientWidth property is zero for inline elements and elements with no CSS; otherwise, it's the inner width of an element in pixels. It includes padding but excludes borders, margins, and vertical scrollbars (if present).
intElemClientWidth is an integer corresponding to the clientWidth of element in pixels. The clientWidth property is read–only.
![重学之JavaScript HTML Element 常用API解析](http://img.jiangsulong.com/220405/0K423B94-1.jpg)
文章插图
clientHeight
The Element.clientHeight read-only property is zero for elements with no CSS or inline layout boxes; otherwise, it's the inner height of an element in pixels. It includes padding but excludes borders, margins, and horizontal scrollbars (if present).
clientHeight can be calculated as: CSS height + CSS padding - height of horizontal scrollbar (if present).
This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect().
【重学之JavaScript HTML Element 常用API解析】
推荐阅读
- 红碎茶品质鉴别方法着重内质的汤味和香气
- 梦见自己又回到高中上学去了 梦到重回高中上学
- 手机边框掉漆怎么修复?这几种方法可以尝试,但选择之前要慎重
- 鼻炎严重会导致什么
- 最世界上最大的龙虾有多大多重 世界上最大的龙虾有多重
- 你知道寒露对安溪铁观音有多重要
- 翡翠|对于翡翠首饰来说,它的种色和形状影响都很大,一定要都重视
- 前端:html+css+javascript 手把手教大家编写贪吃蛇小游戏
- 网站优化中关键词密度的重要性
- 如何简单理解 JavaScript 的 Async 和 Await?