参考:
https://blog.csdn.net/qq_44472722/article/details/105512621
https://blog.csdn.net/weixin_42182143/article/details/103161838
https://blog.csdn.net/qq_41633396/article/details/117352112
https://zhuanlan.zhihu.com/p/35530720
1.第一类——定位类
CSS中的定位分为四种,默认值 static ,相对定位 relative ,绝对定位 absolute 还有固定定位 fixed 。对于位置属性top、bottom 、left、right采用百分比形式,这四种不同定位的百分比参照物如下:
- static:position的默认值,并没有对元素起到定位的作用,所以left、right等位置属性并不能被有效赋值,不存在定位功能上的%值。
- absolute:相对于最近一层的设置了定位的父元素(除去static),left和right相对于width,top和bottom相对于height。
- rela