How often is the default font size in the browser not 16px?

前端 未结 3 1736
忘掉有多难
忘掉有多难 2021-01-04 04:41

After writing a great big answer to the question Is it bad to work with pixels in CSS? in which I concluded that there\'s normally nothing wrong with it provided you underst

3条回答
  •  误落风尘
    2021-01-04 05:37

    Late reply to the question; Defining your font size to a fixed size (px) or (pt) would mean that your site visitor can't increase the size of your Web page text. You might say "great", but this doesn't allow someone with visual disabilities to adjust browser settings to increase font size. If you're designing a website for the general public or for the government, this is a big "no-no".

    To be on the safe side use relative measurements (em) or (%) that allow for font adjustment in a browser.

提交回复
热议问题