Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics (2014) The Box Model Margins

Ermin Mekic
Ermin Mekic
1,063 Points

How to figure out the default font-size?

What if I don't set any specific font-size for a heading, how do I find out what the relative margin to the heading is? Is there a default font-size for h1, h2, h3, etc.?

Thank you.

hungryfr33lanc3r
hungryfr33lanc3r
9,206 Points

Hello, Ermin! If you do not set a font-size, 16px is the default that the browser will implent.

Read more here...

2 Answers

Steven Parker
Steven Parker
231,269 Points

The actual size depends on the browser and/or CSS, but here are some approximations:

H1  32px     
H2  24px
H3  18px    
H4  16px  (also plain inline text)
H5  13px
H6  10px

It depends on the browser, but inspecting the element using developer tools can be helpful.

Here's a course using Chrome Dev Tools..