Files
ClassContent/历届学生/18课程/class18/课程/2020-10-12/笔记.txt
2024-09-27 02:06:13 +08:00

25 lines
696 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

盒子模型
div 的实际宽高 = 你设置的宽高 + 左右边框 + 左右padding
box-sizing: border-box
定位
相对定位 relative
定位参考对象:自己原本的位置进行移动,已经脱离文档流,原本位置没有从文档流中删除
绝对定位 absolute
定位参考对象:
1如果父元素已经定位那么参考父元素的位置进行定位
2如果父元素没有定位那么参考浏览器
已经脱离文档流,原本位置从文档流中删除
固定定位
定位参考对象:浏览器边框, 已经脱离文档流,原本位置从文档流中删除
z-index: 越大浮动的越高,越小越低