Why isn't the CSS property 'line-height' letting me make tight line-spaces in Chrome?

后端 未结 4 1743
刺人心
刺人心 2021-02-05 02:27

I have a paragraph tag that I defined elsewhere with a line height of 15px, and I have another paragraph tag further down the page where I want to make the line height around 10

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 02:59

    I've noticed in both Firefox and Chrome that if you set the HTML5 doctype there's a minimum line-height for inline elements. For block elements you can set the line-height to whatever you want, even make the lines overlap.

    If you don't set the HTML5 doctype, there's no minimum line-height for either block or inline elements.

提交回复
热议问题