What is 62.5% here! And what does it do ** **
*,
*::before,
*::after {margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
What is 62.5% here! And what does it do ** **
*,
*::before,
*::after {margin: 0;
padding: 0;
box-sizing: inherit;
}
html {
font-size: 62.5%;
box-sizing: border-box;
}
font-size: 62.5%;
on html
tag is a method helping you to convert easily px
to rem
.
As 62.5% of the default font size in browser (16px) is equal to 10px, convert pixel values to rem
values become easy. For example, 1.6rem will have a 16px rendering (16/10=1.6).
You can get more informations about CSS font size units on this link : https://medium.com/code-better/css-units-for-font-size-px-em-rem-79f7e592bb97
Percent in font size is used to make it scalable wrt different devices. i.e mobile, desktop ipad etc.