开发者

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

开发者 https://www.devze.com 2022-12-17 04:08 出处:网络
What are cons to use % over em in t开发者_如何学运维erms of accessibility?I don\'t think there are any any more.

What are cons to use % over em in t开发者_如何学运维erms of accessibility?


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.


% 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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号