html - How to set em to 10px for complete website -


i creating template responsive website. learned em use in responsive design. problem set body font-size 62.5% when using p,span , other elements fontsize 2em 2 em different 20px. according default font-size should 2em=20px anywhere in body 62.5% overrides default 1em=16px 10px. please suggest should change in whole body whenever set font-size of element 2em same 20px.

body {font-size:62.5%} 

this takes 16px down 10px. on it’s easy think in pixels still set sizes in terms of ems: 1em 10px, 0.8em 8px, 1.6em 16px, etc.

.element {       font-size: 20px;       width: 4em;       height: 4em;   }  

then means width , height of element (defined here 4em x 4em) compute 80px x 80px (20px * 4 = 80px).

read 1 read 2


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -