CSS font-size changes when font-family falls back

前端 未结 6 1883
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 10:31

I want to use a font (gill sans) which renders very small due to a short x-height etc. etc. If I set this at a reasonable size, and then a browser falls back to a more typic

6条回答
  •  囚心锁ツ
    2020-12-14 10:59

    You can specify a font-size in the body selector and thus neutralize the browser's default size, i.e.

    body { font-size: 62.5%; }
    

    62.5% is a good baseline because it allows you to easily use ems to relatively set the font-size of elements in the body.

    At 62.5%, 1em = 10px, 1.2em = 12px and so on.

    Just set a font-size in the body as baseline and style elements accordingly.

提交回复
热议问题