..
Doing this type of calculation is very simple.
First you need to know the size of default font-size defined for the body.
For our example we assume that this value corresponds to 12 px.
The unit of em, in fact, the relative nature and refers to this default value.
To put it simply, em is a kind of multiplier default size.
So, a page element with
font-size: 1.5 emwill have a pixel size equal to the result of this multiplication:
* 1.5 = 12px 18px
Conversely, if we wanted to know the size of an em font-size in pixels should do the reverse:
18px / 12px = 1.5 em
| |
CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €. |
| |
HTML (Course)
The markup language for the Web from 29 €. |
| |
Webmaster Advanced (Course)
Become a professional Webmaster. From 39 €. |