当前位置: 首页 > Web前端 > CSS

css单位距离比较

时间:2023-03-30 14:20:53 CSS

unitem    如果没有设置字体大小,会根据父级计算为font-size*emrem   html{font-size:10px;}   bodyelement{font-size:1rem;}//字体大小:10px;   不仅有font-size,margin,padding等等   html{font-size:62.5%;}//font-size:10px;10/16100%distancemargin    百分比:根据父元素的宽度计算    负值:相对于父元素    css2.0规范对于marginoverlap有如下描述:1.水平边距永远不会重合2.Verticalmarginsmayoverlappaddingpercentagebetweenspecificboxes:根据父元素的宽度计算**没有负值**参考链接:https://www.cnblogs.com/mengf...https://www.jianshu.com/p/6e4...