Remove Extra Space at Bottom of HTML List Item

前端 未结 6 733
刺人心
刺人心 2020-12-31 05:20

Is there any way to remove the extra space displayed at the bottom of an HTML List Item tag without setting a fixed height on the list item? I.e. I would like the li

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 06:07

    This is your code: http://jsfiddle.net/23LcK/

    The gap is nothing to do with the lis. It's the space reserved for descenders in letters like g and p (because the imgs are inline elements).

    You can remove it with any of these applied to li img:

    • display: block: http://jsfiddle.net/23LcK/1/
    • vertical-align with top or bottom: http://jsfiddle.net/23LcK/2/

提交回复
热议问题