<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt" -->

---
title: Accessibility and font sizes | daily.dev
description: Using static pixel units for font sizes in CSS breaks browser accessibility settings that let visually impaired users scale text, since browsers prioritize...
canonical: https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Accessibility and font sizes | daily.dev
og:description: Using static pixel units for font sizes in CSS breaks browser accessibility settings that let visually impaired users scale text, since browsers prioritize...
og:url: https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt
og:image: https://api.daily.dev/og/posts/hnVp4LoMt.png
og:image:alt: Accessibility and font sizes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessibility and font sizes

**[Craig Abbott](https://daily.dev/sources/craigabbott)** · 9 min read · 0 upvotes · 0 comments

## Summary

Using static pixel units for font sizes in CSS breaks browser accessibility settings that let visually impaired users scale text, since browsers prioritize website CSS over user preferences. The piece explains why pixels are fixed while relative units like REM, EM, and percent scale with user settings, walks through how EM causes compounding issues in nested elements while REM avoids this by always referencing the root element's font size, and recommends using REM for font sizes and margins, percent for container widths, and reserving pixels only for non-scaling stylistic elements like borders.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.craigabbott.co.uk/blog/2022/accessibility-and-font-sizes>

## Questions this post answers

### Why does changing the browser font size setting not affect text on some websites?

It happens because the website uses pixel units for font sizes in its CSS, and pixels are a static unit tied to the physical screen rather than to browser settings. Browsers prioritize a website's own CSS over user accessibility settings, so if a site hardcodes font-size in px, changing the browser's font size preference (like Chrome's medium, large, or very large options) has no effect on that text.

_daily.dev surfaces practical accessibility guidance for developers debugging font scaling issues like this._

### What is the difference between em and rem units in CSS?

Em units inherit their size from the parent element, which can cause compounding when nested elements each multiply the size again, unexpectedly producing much larger or smaller text than intended. Rem units always calculate from the root html element's font size instead, avoiding compounding entirely. For example, nesting 2em elements four levels deep can balloon 16px text to 128px, while the same nesting with 2rem stays a consistent 32px at every level.

_Developers choosing between em and rem for scalable layouts can find comparisons like this on daily.dev._

### Why should I avoid using pixels for font size in CSS for accessibility?

Pixel font sizes are static and always render at the same physical size regardless of a user's browser font size preference, which is part of the User Agent Accessibility Guidelines (UAAG) that let visually impaired users scale text. Relative units like rem, em, or percent instead scale relative to the user's chosen base font size (commonly 16px, 20px, or 24px), preserving that accessibility control. Pixels should be reserved for non-scaling elements like borders.

_daily.dev helps developers stay sharp on accessibility best practices like choosing scalable CSS units._

## Similar posts on daily.dev

- [All you need to know about pixels](https://daily.dev/posts/all-you-need-to-know-about-pixels-ydeuxp4mm) · ITNEXT · 1 upvotes · 0 comments
- [Why default Tailwind is not always an accessible choice](https://daily.dev/posts/why-default-tailwind-is-not-always-an-accessible-choice-efwxtqbfi) · Spatie · 50 upvotes · 5 comments
- [Death to px, long live ch\!](https://daily.dev/posts/death-to-px-long-live-ch--hw0sq1nxi) · Terence Eden · 6 upvotes · 6 comments
- [Responsive and Fluid Typography with Baseline CSS Features](https://daily.dev/posts/responsive-and-fluid-typography-with-baseline-css-features-rnoepawxs) · OddBird · 4 upvotes · 0 comments
- [7 modern CSS units your LLM keeps ignoring](https://daily.dev/posts/7-modern-css-units-your-llm-keeps-ignoring-pbazwuues) · RUBYLAND · 0 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css), [#ui-design](https://daily.dev/tags/ui-design), [#accessibility](https://daily.dev/tags/accessibility)

[View this post on daily.dev](https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Accessibility and font sizes","url":"https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt"},"datePublished":"2026-09-20T07:44:06.640Z","dateModified":"2026-09-20T07:46:01.790Z","description":"Using static pixel units for font sizes in CSS breaks browser accessibility settings that let visually impaired users scale text, since browsers prioritize...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a0ffc407e6f6c1b75eadc5a3e5dc0325?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a0ffc407e6f6c1b75eadc5a3e5dc0325?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Craig Abbott","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Craig Abbott","logo":"https://media.daily.dev/image/upload/s--7L_KxzEH--/f_auto,q_auto/v1789890198/logos/craigabbott?_a=BAMAMicg0","url":"https://daily.dev/sources/craigabbott"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,css,ui-design,accessibility","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Craig Abbott","item":"https://daily.dev/sources/craigabbott"},{"@type":"ListItem","position":3,"name":"Accessibility and font sizes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/accessibility-and-font-sizes-hnvp4lomt#faq","mainEntity":[{"@type":"Question","name":"Why does changing the browser font size setting not affect text on some websites?","acceptedAnswer":{"@type":"Answer","text":"It happens because the website uses pixel units for font sizes in its CSS, and pixels are a static unit tied to the physical screen rather than to browser settings. Browsers prioritize a website's own CSS over user accessibility settings, so if a site hardcodes font-size in px, changing the browser's font size preference (like Chrome's medium, large, or very large options) has no effect on that text. daily.dev surfaces practical accessibility guidance for developers debugging font scaling issues like this."}},{"@type":"Question","name":"What is the difference between em and rem units in CSS?","acceptedAnswer":{"@type":"Answer","text":"Em units inherit their size from the parent element, which can cause compounding when nested elements each multiply the size again, unexpectedly producing much larger or smaller text than intended. Rem units always calculate from the root html element's font size instead, avoiding compounding entirely. For example, nesting 2em elements four levels deep can balloon 16px text to 128px, while the same nesting with 2rem stays a consistent 32px at every level. Developers choosing between em and rem for scalable layouts can find comparisons like this on daily.dev."}},{"@type":"Question","name":"Why should I avoid using pixels for font size in CSS for accessibility?","acceptedAnswer":{"@type":"Answer","text":"Pixel font sizes are static and always render at the same physical size regardless of a user's browser font size preference, which is part of the User Agent Accessibility Guidelines (UAAG) that let visually impaired users scale text. Relative units like rem, em, or percent instead scale relative to the user's chosen base font size (commonly 16px, 20px, or 24px), preserving that accessibility control. Pixels should be reserved for non-scaling elements like borders. daily.dev helps developers stay sharp on accessibility best practices like choosing scalable CSS units."}}]}
```

