开发者

How does using 'em' help me in css? [duplicate]

开发者 https://www.devze.com 2023-04-12 22:55 出处:网络
This question already has answers here: Why em instead of px? (15 answers) Closed 9 years ago. I\'ve heard that using \'em\' for font size is recommended. I\'ve tried it, but I really don\'
This question already has answers here: Why em instead of px? (15 answers) Closed 9 years ago.

I've heard that using 'em' for font size is recommended. I've tried it, but I really don't see any advantage of it. Actually, all of my co-workers were confused.

I've read few articles over the internet about %, em, and px. All of them suggested em, but I really don't understand it. Yes, I can change all the font size at once by usi开发者_StackOverflowng em...is that it?

I've tried several smartphones and all of them displayed 'px' without a problem...

Someone please guide me!

Thanks


The font unit em allows you to display font size ( as well as other element's size , e.g. images ) based on browser's configuration.

You can still use px as font unit, but 14px browser on mobile is different than 14px on desktop browser.

0

精彩评论

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

关注公众号