How does using 'em' help me in css? [duplicate]
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.
精彩评论