![](https://img.haomeiwen.com/i27388007/175520bd55256e1d.png)
行内非替换元素 span/a/strong/i
1.宽度高度不生效
2.padding比较特殊,设置左右padding没问题,上下可以称起来,
但是上下padding不占据空间
3.border上下会被撑起来,但是不占据空间
4.margin左右生效,上下不生效,
为什么不生效:因为行内元素一般都是和其他元素在一行显示的,左右生效的化会破坏美感。
margin:
![](https://img.haomeiwen.com/i27388007/e39b968605317630.png)
![](https://img.haomeiwen.com/i27388007/ae7138033fb078c3.png)
padding
![](https://img.haomeiwen.com/i27388007/a206ee708dc8eb48.png)
![](https://img.haomeiwen.com/i27388007/852231ef8d6feea0.png)
上下padding没有其效果,而是延申到了上面和下面盒子的地方了
border
![](https://img.haomeiwen.com/i27388007/a34b6d4597c60b78.png)
![](https://img.haomeiwen.com/i27388007/0a6f9134be47e88e.png)
行内非替换元素 span/a/strong/i
1.宽度高度不生效
2.padding比较特殊,设置左右padding没问题,上下可以称起来,
但是上下padding不占据空间
3.border上下会被撑起来,但是不占据空间
4.margin左右生效,上下不生效,
为什么不生效:因为行内元素一般都是和其他元素在一行显示的,左右生效的化会破坏美感。
margin:
padding
上下padding没有其效果,而是延申到了上面和下面盒子的地方了
border
本文标题:2022-07-31(四)
本文链接:https://www.haomeiwen.com/subject/isukwrtx.html
网友评论