What does half a pixel mean in the font-size CSS property?

后端 未结 2 432
予麋鹿
予麋鹿 2021-01-11 23:29

I\'m currently working on a website redesign and I\'m receiving a list with the required changes from an agency.

The header menu of the site currently has the follow

2条回答
  •  自闭症患者
    2021-01-11 23:40

    The font-size property is used as a parameter when the browser draws characters, so it affects the size of glyphs. But when glyphs are rasterized to bitmaps, the effect of, say, increasing font-size by 0.5px may vanish. Browsers may perform rasterization in different ways. Moreover, they may or may not use subpixel rendering, and in different ways.

    If line-height has been set to 1em and font-size is increased from 11.5px to 12px, then the height of the line box may remain the same or be increased by one pixel, depending on the rounding applied by a browser.

提交回复
热议问题