Jump to content

H1-H6 Font Size Behavior


knystrom18

Recommended Posts

I set a CSS rule:

html, body {... ...font-size: 14px;}

And the header tags all scaled down in size from their default styling, but not to 14px. Why is that? Is there a goal within browsers rendering to keep headers and text proportionately sized?

Link to comment
Share on other sites

Then according to my rule above, since (to my knowledge, there is no parent to html) 1em would be equal to 14px? If I were to set the font to 10px, would then 1em be 10px?

Link to comment
Share on other sites

If there were no default font size set in a stylesheet, the browser's default font size, or users set default font size would take over (let's say 16px for both). So then 1em would be 16px, right? I think there can be something like a ".5em", but can there be negative em's like "-1em"?

Link to comment
Share on other sites

So now I've got these rules:

html, body { font-size: 10px;} ... h1 {font-size: 2em;}h2 {font-size: 1.8em;}h3 {font-size: 1.6em;}

Can that be simplified in any way without using something like less.js?

Link to comment
Share on other sites

The implementation seems pretty simple. It doesn't seem too hard to use. But for more advanced users, you can bypass the JS imposition by compiling it on the server side using Node.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...