CSS 中使用 px,em,rem

目前还不理解它们的应用场景,暂时倾向于使用 em,rem 少用 px 。

一种观点:

  • Pixels are ignorant, don't use them.
  • Use REMs for sizes and spacing.
  • Use EMs for media queries.

——来自阅读材料 1

一些阅读材料:

  1. https://engageinteractive.co.uk/blog/em-vs-rem-vs-px
  2. https://stackoverflow.com/q/11799236/12539782
  3. https://zellwk.com/blog/media-query-units/
  4. Numbers, lengths, and percentages - MDN
  5. REM vs EM – The Great Debate
  6. https://web.dev/learn/css/sizing/
  7. What does 100% mean in CSS?
  8. https://www.w3.org/TR/css-values-4/#px
欢迎通过「邮件」或者点击「这里」告诉我你的想法
Welcome to tell me your thoughts via "email" or click "here"