[JavaScript]元素尺寸定位总结[含兼容性、文档模式测试]

1. 基本概念 相对于定位了的父容器 注意不含滚动条宽度 相当于content+padding 注意不含滚动条宽度 注意不含border 相对定义了relative的父容器 offsetWidth clientWidth scrollWidth style.width offsetHeight clientHeight scrollHeight style.height 相对于定位了的父容器 相当
相关文章
相关标签/搜索