css解决多个span间的间距问题
使用场景:显示价格时,会出现下图中的样式
¥39.9
解决方法如下:
父级元素使用font-size: 0
1 2 3 4 5 |
<div class="goods-normal-price"> <span class="goods-price-one">¥ </span> <span class="goods-price-two">39</span> <span class="goods-price-one">.9</span> </div> |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
.goods-normal-price { color: #E02020; font-weight: 500; font-size: 0; } .goods-price-one { font-size: 19px; } .goods-price-two { font-size: 39px; } |