WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: accessibility for low vision!

for

From: JP Jamous
Date: Feb 3, 2017 8:37AM


Thank you for the correction Patrik. I did this in 2008 - 2009. I am glad to notice that this has been taken care of across browsers.



-----Original Message-----
From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf Of Patrick H. Lauke
Sent: Friday, February 3, 2017 8:48 AM
To: <EMAIL REMOVED>
Subject: Re: [WebAIM] accessibility for low vision!

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