Back in the days before browser “zoom”*, making text bigger on the page was done by incrementing all the font sizes in the document. All fonts set at 16px became, for example 18px, and all fonts at 20px became 22px.
The problem with this was that often text would outgrow the element it appeared in, because the element was also given a width and height in pixels and this didn’t get scaled as the text size increased or decreased.
Sometimes even if you built a site that allowed text to grow and wrap, it would get to a stage where a single long word was wider than its container, and the overflow would have to either be hidden, or just left visible to run into whatever element was placed on the immediate right. Not only that, but there are just some situations where you don’t want elements to wrap – whether they’re text nodes, floated elements with text in them, or inline-bock elements that you often find in navigation lists.
We didn’t want text zoom, we wanted magnification zoom i.e. the zoom that we have nowadays…but it didn’t exist.
Em to the rescue! Luckily, the em unit is intrinsically linked to text size. It is a relative unit, meaning that the actual size of an em depends on the font-size of its container. Clever people figured out that you could simulate magnification zoom if you measured all your widths and heights using relative units.
How does that work?
Well, if your font sizes are all increased, and everything else is measured in em’s (the width of the letter ‘M’), then everything else gets bigger as well, in proportion. Hooray!
Sure, but why would we use them nowadays?
Firstly, if someone is using an old browser that doesn’t support magnification zoom, or is using the (still existing) older text size zoom, you don’t get the problems I’ve just described above that are inherent to text zoom.
Secondly, if you never define an absolute text size for your document, your viewers are free to set their own default text size (On Firefox you can do this by visiting preferences > content > fonts & colours), and your layout will change size to accommodate. Almost all browsers set their text size at 16px by default, so if you use this as your base – i.e. 16px = 1em, then your site will be the size your designer is probably expecting it to be.
I use em’s for almost all units that could also be expressed in pixels, or percentages or whatever. Percentages almost certainly have a very important place as well, but unless you’re working with a fluid design they’re not a necessity.
* Which, for your reference, works by changing the definition of how big a pixel is on your screen. It means you’re really working with points, not pixels, but that’s by the by.
https://onlinevetjobs.com/author/madelyn541/
https://onlinevetjobs.com/author/madelyn541/
https://lospromotores.net/author/wantjqf120/
https://lospromotores.net/author/wantjqf120/
http://lucatiadesign.co.uk/author/towersrbu295/
http://lucatiadesign.co.uk/author/towersrbu295/
https://apptuts.bio/madelyn541-317720
https://apptuts.bio/madelyn541-317720
https://www.chordie.com/forum/profile.php?id=2700670
https://www.chordie.com/forum/profile.php?id=2700670
http://www.tabletwetestates.es/author/alignmentitz0287/
https://hype4.academy/profile/stranger-48403
https://hype4.academy/profile/stranger-48403
http://www.tabletwetestates.es/author/alignmentitz0287/
https://hype4.academy/profile/stranger-48403
http://www.tabletwetestates.es/author/alignmentitz0287/
https://thejocoxway.org.uk/author/develjgq6240/
I simply couldn’t leave your web site prior to suggesting that I extremely enjoyed the standard information an individual supply on your guests? Is going to be again regularly to inspect new posts
https://thejocoxway.org.uk/author/develjgq6240/
https://sfx.thelazy.net/users/u/madelyn541/
https://thejocoxway.org.uk/author/develjgq6240/
https://sfx.thelazy.net/users/u/madelyn541/
https://awan.pro/forum/user/228450/
https://awan.pro/forum/user/228450/
https://pxhere.com/en/photographer/5161068
https://springsinternational.org/author/dramaticallydzy78/
https://springsinternational.org/author/dramaticallydzy78/
https://www.backabuddy.co.za/campaign/poppers
https://russasnet.com.br/author/capenbq06/
https://russasnet.com.br/author/capenbq06/
https://russasnet.com.br/author/capenbq06/
https://linkmix.co/60816171
http://brasilcaminhoneiro.com.br/author/automatedaey2909/
http://brasilcaminhoneiro.com.br/author/automatedaey2909/
https://linkmix.co/60816171
http://brasilcaminhoneiro.com.br/author/automatedaey2909/
https://startupxplore.com/en/person/madelyn541
https://startupxplore.com/en/person/madelyn541
https://startupxplore.com/en/person/madelyn541
https://cristina-soto.com/author/postyqi74/
https://cristina-soto.com/author/postyqi74/
https://cristina-soto.com/author/postyqi74/
https://zukongguan1.com/?223396
https://zukongguan1.com/?223396
https://monkeyhousegames.com/author/archxba887/
https://monkeyhousegames.com/author/archxba887/
https://www.zukongguan.com/home.php?mod=space&uid=223396&do=profile
https://www.zukongguan.com/home.php?mod=space&uid=223396&do=profile
https://www.videofestivalimperia.org/author/examboj83/
https://www.videofestivalimperia.org/author/examboj83/