/ Published in: CSS
Using fluid measurements like 'em' or % on your fonts is a great way to help create more fluid designs. It can be a pain though to calculate ‘em’s for every different element. A simple trick is to set your base font to be the equivalent of 10px. Since the default font-size of browsers is 16px you can set a base font-size with the following:
Now if you want your h1 to be 24 px the calculation is much easier
Expand |
Embed | Plain Text
1 body { 2 font-size:62.5%; 3 } 4 10/16 = 62.5% 1 h1 { 2 font-size: 2.4 em; 3 }
You need to login to post a comment.
