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 Adding Pages to a Website Add a New Page

Instead of <h3> why not use <h1> or <h2>?

In the About page, after adding the picture why did you add a 3rd level heading? Why not <h1> or <h2> instead?

Andrew Robinson
Andrew Robinson
16,372 Points

He could have used either, it's a stylistic choice, imagine you are developing a website, one of the first things you do in CSS is set some of the header font-size properties, so you have an idea of how big the text will be, in this case Nick chose to use h3 so the text wasn't huge on the about page and dominated the page.

This makes sense, from an aesthetic standpoint, yes. But from a semantic standpoint? Isn't it important for the HTML document structure to be semantically correct?

Andrew Robinson
Andrew Robinson
16,372 Points

I'd say it's still semantically correct also, as the text inside the h3 tag is still a header, if the text inside the h3 tag was a big paragraph then it wouldn't be semantically correct, semantics are more to do with, "does this tag for this content make sense?".

1 Answer

Corey Gibson
PLUS
Corey Gibson
Courses Plus Student 4,044 Points

Also when you go to validate a site with w3c, it might give an error. In validation it expects that h1 should be used like an ID there is only one h1 element on the page(like main page heading), and like wise it expects to only have a few h2 elements on the page(section headings). Really its nothing more then best practice.

Having only one h1 element - which usually goes for the Logo - is an old practice used in XHTML. But now that HTML5 is out, what I know is that h1 should be used as a headline for each new section in the page. This means one page can have as many h1 elements as there are structure elements in the document. That's why I wondered why Nick Pettit picked precisely h3 instead of h2 and h1, I'm trying to make sure my information is correct.