WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: accessibility for low vision!

for

From: Patrick H. Lauke
Date: Feb 3, 2017 7:47AM


On 03/02/2017 14:42, JP Jamous wrote:
> Just one thing to keep in mind when using EM or percentage. 1EM > 16PX, which is 12PT. However, each browser agent translates those
> numbers differently. I had the pleasure of dealing with this mess a
> few years back.

The exact value of what a browser sets as "1em" can depend on user
settings. With vanilla settings, the vast majority of browsers nowadays
default to 16px as default size. The only browsers which, out of the
box, have a different pixel value for 1em are - to my knowledge at least
- some browsers on e-readers/tablets.

> Ensure that you find the common ground between the browsers you
> support and through If statements identify each browser and set the
> number properly. Example,
>
> If Browser == IE Then Font-size: 0.98EM; Else If Browser == Firefox
> Then Font-size: 1EM;
>
> You get the point.

I would strongly advise against doing that, unless your design depends
on being pixel accurate (in which case you have bigger problems). By all
means, set it to 1em, and trust that the browser is using a sensible
default / the user has customised their browser settings to an
appropriate default size.

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke