- 基本概念
标准盒模型/IE盒模型
- 标准模型与IE模型的区别
标准模型:width=content
IE模型:width=content+padding+border
- CSS如何设置盒模型
box-sizing:content-box/border-box
- JS如何获取盒模型的宽与高
1.dom.style.width/height---->内联样式
2.dom.currentStyle.width/height---->获取渲染后的宽高,只支持IE
3.window.getComputedStyle(dom).width/height---->获取渲染后的宽高,兼容性好
4.dom.getBoundingClientRect().widht/height---->计算元素绝对位置,获取到四个元素left,top,width,height
- BFC
1.基本概念
块级格式化上下文
2.原理
3.如何创建BFC
3.1.根元素
3.2.overflow不为visible
3.3.position为absolute/fixed
3.4.float不为none
3.5.display:inline-block/table-cell/table-caption/flex/inline-flex