CSS: reducing line spacing of text?

后端 未结 3 1810
无人及你
无人及你 2020-12-18 17:55

I am having difficulty reducing the spacing between lines of text with CSS line-height (or height - I\'ve tried both).

I have a small bit of text and the spacing is

相关标签:
3条回答
  • 2020-12-18 18:47

    Inline elements don't honour properties such as line-height; they take on the line height of the nearest block parent.

    See Fiddle

    Solution: remove the line-height from the body, or turn the span into a block (i.e. make it a div; don't give display:block to the span).

    0 讨论(0)
  • 2020-12-18 18:47

    You have a line-height: 21px; In the body. Remove this, and it should work.

    0 讨论(0)
  • 2020-12-18 18:54

    Add display:block & remove height.

    <span style="font-size: 75%; line-height: 16px; display:block">blog posts & occasional updates (updates max 1 every 14 days)</span>
    

    You learn more about display:block property here.

    0 讨论(0)
提交回复
热议问题