参考
https://www.cnblogs.com/layaling/p/6223372.html
https://www.cnblogs.com/wenruo/p/9754576.html
正文
以一个div盒子模型为例。
height
内容的高度,不包含padding,margin,border等仅仅表示内容显示的高度
offsetheight
offsetheight = 内容高+padding+border
clientHeight
clientHeight = 内容高+padding
scrollHeight
scrollHeight 滚动条的高度
注释:出现滚动条的条件是页面高度大于body的时候,scrollHeight包括由于溢出导致的视图中不可见内容。
最后
以上就是苹果小兔子最近收集整理的关于height、offsetheight、clientheight、scrollheight区别简单理解的全部内容,更多相关height、offsetheight、clientheight、scrollheight区别简单理解内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复