My Logs.

Building. Thinking. Writing.

Go back

Stop Using px for Font Sizes

1 min read Edit page

Use rem for font sizes. Here’s why:

px ignores user preferences. rem respects browser font settings.

/* Bad - ignores accessibility */
body { font-size: 16px; }

/* Good - respects user settings */
body { font-size: 1rem; }

Users who set larger fonts in their browser need it for a reason.

Respect that.


Edit page