[英]Removing unexpected space in :before :after pseudo elements
添加行高:0; 修复了问题,如下:
.div:after {
position: absolute;
content: url(svg/curve-down-bottom.svg);
width: 100%;
line-height: 0;
bottom: -1px;
left: 0;
z-index: 999;
}
你可以在这里看到:
正如其他人评论的那样,您还可以添加display: block; . 这在过去曾处理过类似的问题,其中图像下方有空间,但是这个特定问题line-height:0; 提供了想要的结果。
.div:after {
position: absolute;
content: url(svg/curve-down-bottom.svg);
width: 100%;
line-height: 0;
bottom: -1px;
left: 0;
z-index: 999;
display: block;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.