html - How to achieve same line heights in firefox and chrome? -


When using the same font, Chrome and Firefox give them different line heights, and sometimes you need them Browsers should be the same. .. While facing this problem now, I have to give both the font size and the height of the line in pixels, but this does not seem to be the best solution. Can different units be used? How do I render fonts to Chrome and Firefox?

You can set the height of the line as a pure number, which is the definition of the element The font will be taken as relative to the size, eg line-height: 1.2 .

You can optionally use the em unit, e.g. Line-height: 1.2 AM , but then the internal elements are received (unless the height of their own line is determined) Calculation value, not the relative number. This thing is if nested elements have different font sizes, and usually relative line height should be used.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -