第一种    

对img设置竖直方向对齐为middle

<div>    
        <img src="" alt="" class="heart">    
        <span>1169</span>    
        <img src="" alt="" class="comment">    
        <span>1168</span>    
</div>    
div{    
     height:30px;    
     line-hight:30px;    
}    
.heart,.comment{    
        vertical-align:middle;    
}  

第二种

把小图标设为背景图片,调整padding

<div>    
        <span class="heart">1169</span>    
        <span class="comment">1168</span>    
</div> 
.hear{    
        background:url(images/heart.png) left center no-repeat;    
        margin-right:20px;    
}    
.comment{    
        background:url(images/comment.png) left center no-repeat;    
}    
.hear,.comment{    
        height:30px;    
        line-height:30px;    
        padding-left:20px;    
}    

 

相关文章:

  • 2022-12-23
  • 2021-11-26
  • 2021-12-14
  • 2022-12-23
  • 2021-11-21
  • 2021-11-17
  • 2022-01-19
  • 2021-07-12
猜你喜欢
  • 2022-02-07
  • 2021-11-21
  • 2022-12-23
  • 2021-04-16
  • 2022-12-23
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案