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

后端 未结 2 439
予麋鹿
予麋鹿 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:41

    I think there is a difference. You forgot about the Zoom level of the page.

    Example :

    aAa

    aAa

    aAa

    aAa

    aAa

    If we zoom to 500%, we can see there is a difference:

    Zoom levels

    I think your browser has to round it because half pixels (real pixels) don't exist.

    Zoom 100% :

    Round(12 * 1.00) = 12

    Round(11.5 * 1.00) = 12

    Zoom 500% :

    Round(12 * 5.00) = 60

    Round(11.5 * 5.00) = 58

提交回复
热议问题