Forum Moderators: not2easy
I am guessing that if I have nested elements, each with a font-size:0.8em, that at each level, the text size is 0.8 the size of the text in the parent.
Am I guessing correctly - it is more complicated than I thought.
If there is a default font size for each browser, are there also default DIV margin and / or padding sizes?
I had obviously declared a font size in more places
x-small
small
medium
large
et cetera. These are always based on the document's overall default size. But be careful though: here too the browser may have its own opinion of how much smaller each "small" will be. Why do you want your document's overall text size to be 20% smaller than what the user is accustomed-- and perhaps explicitly prefers-- to read?
body {
font-size: 100%; /* Relative to the browser default, 16px; */
}
p {
font-size: .5em; /* Relative to the parent */
}
a {
font-size: .5em; /* Relative to the parent */
}
<body>
This text is 16px.
<p>
This text is 8px.
<a href="#">
This text is 4px;
</a>
</p>
</body>