yangbo5207 / everyday

Something I learn every day.
5 stars 0 forks source link

CSS: 100% font size - 100% of what? #13

Open yangbo5207 opened 8 years ago

yangbo5207 commented 8 years ago

You can set the default font-size in the body, like so

body {
    font-size: 14px;
}

now, the font-size of all my page will inherit a font-size of 14px. Then I want a DIV tag that className is 'inner' have a font-size 10% smaller than body. I simply do.

.inner {
    font-size: 90%;
}

the same mean, if I want this DIV's font-size 10% bigger than body, I will set

div {
    font-size: 110%;
}