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

HTML How to Make a Website HTML First Create the Content Containers

Yusfu Daramay
Yusfu Daramay
166 Points

What's the point of the h1 and h2 lines in this code?

What purpose does the h1 and h2 lines serve. I see how the header, section, footer, was made and their significance. But what did the h1 and h2 do. Especially the h2.

4 Answers

The h1 and h2 tags are for different levels of headings. By default, they get smaller as you go up in number.

You can read more here- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements

H1-2-3 is just a type of headlines . under which you can add your paragraph mostly!

Matthew Tran
Matthew Tran
16,343 Points

It allows you to customize each one differently. Yes, you'll want a lot of your headers to look the same but this does give it flexibility. You could make one bigger than the other or stand out differently.

Rasmus Hall
Rasmus Hall
1,260 Points

there are 6 headers, h1, h2, h3, h4, h5 and h6, the higher up you go the smaller they get. you can use each as much as you want