[英]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.