"Type of unit similar to "em", but relative only to the root element, not any parent element. Thus compounding does not occur as it does with "em" units."
The problem with em-based font sizing is that the font size compounds. A list within a list isn't 14px, it's 20px. Go another level deeper and it's 27px!
The rem unit is relative to the root—or the html—element. That means that we can define a single font size on the html element and define all rem units to be a percentage of that.
html { font-size: 62.5%; }
body { font-size: 1.4rem; } /* =14px */
h1 { font-size: 2.4rem; } /* =24px */
I'm defining a base font-size of 62.5% to have the convenience of sizing rems in a way that is similar to using px.
consistent and predictable sizing in all browsers, and resizable text in the current versions of all major browsers
We can specify the fall-back using px, if you don't mind users of older versions of Internet Explorer still being unable to resize the text (well, there's still page zoom in IE7 and IE8). To do so, we specify the font-size using px units first and then define it again using rem units.
html { font-size: 62.5%; }
body { font-size: 14px; font-size: 1.4rem; } /* =14px */
h1 { font-size: 24px; font-size: 2.4rem; } /* =24px */
The compounding nature of em-based font-sizing can be frustrating so what else can we do?
Thanksgiving - from this very day, the pleasant holidays start off by indulging, feasting and spending quality time with loved ones. The term was coined in the United States, which means "Giving Thanks" and hence, later people started celebrating it not only in the USA, but also in many countries. Thanksgiving is said to be the "secular holiday" that follows on the 4th Thursday in November. In Canada, this day is rejoiced on the 2nd Monday of October!
This is why it’s always strongly recommended that you use unitless numbers if you’re going to set a line-height on something like the html or body elements, or indeed on any element that is going to have descendant elements.