Jitendra Vyas
Jitendra Vyas

Reputation: 152677

What are cons to use % over em in terms of accessibility?

What are cons to use % over em in terms of accessibility?

Upvotes: 2

Views: 182

Answers (2)

Pieter Jongsma
Pieter Jongsma

Reputation: 3373

% over em?

I would say no advantage concerning accessibility as far as I know, but I would say it is hard to switch from one to the other.

Isn't '%' a relational size, whereas 'em' is an absolute size? The one is for liquid layouts, the other isn't...

Upvotes: 0

Rich Bradshaw
Rich Bradshaw

Reputation: 72965

I don't think there are any any more.

In the olden days, internet explorer wouldn't let you zoom a page if sizes were specified in pixels, but would if in em or %. This led to the recommendation to stay away from pixels in order to allow users to view content at a size useful for them.

Nowadays, all modern browsers do a full page zoom, irrespective of what units you use to size things in, so basically it's up to you.

I often use pixels when things need to be perfectly lined up, and em when sizing fonts and paragraph margins etc to keep a vertical rhythm.

Upvotes: 3

Related Questions