Different line-height in Firefox and Chrome when using text-shadow

后端 未结 2 1014
逝去的感伤
逝去的感伤 2020-12-13 22:20

For some reason, Firefox and Chrome render line-height differently when using text-shadow.

CSS:

#tracker {
           


        
2条回答
  •  攒了一身酷
    2020-12-13 22:22

    Specifying the line height in text-relative units will provide consistent behavior across rendering engines.

    Simply calculate the container-height to text-height relation:

    13 / 9 = 1.444~

    ... and apply that to the relevant rule in the CSS:

    #tracker li {
        line-height: 1.444;
    }
    

    Demo on jsFiddle

提交回复
热议问题