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
James Nelson
23,956 PointsHeading structure order
Hello,
For a document to be semantically correct does the heading structure have to follow h1-h5 very strictly? I know I can't have a h1, h2 followed by an h1 again for multiple reasons.
But can I skip a heading?
For example, h1, h3, h4, h5?
Thanks
7 Answers
James Barnett
39,199 PointsIt doesn't make semantic sense to skip headings, it's like a book that goes Chapter 1, Chapter 2, Chapter 4. You shouldn't be paying any attention the default styling of the headings that's what CSS is for.
Diane Houghton
5,773 PointsIt doesn't matter, each element comes with default sizing. You'll probably change the sizes with CSS anyway
Jonathan Grieve
Treehouse Moderator 91,254 PointsI don't see any problem with that. Nor with using another H1 after having used a H2 but perhaps someone can educate me about that.
So for me,
h1 /h1
.......... >h2 /h2
h1 h1
is just fine for me.
Privado Coronel
13,504 PointsYou can skip heading sir but personally i dont skip heading order, i just plan ahead the font sizes on my heading, from the largest h1 to the smallest h6.
James Nelson
23,956 PointsJohnathan: It is highly recommended to only have one H1 per page as this is the most important heading of one page. Heading's should then fall in semantic order, h1-h6 and should not jump in the order you described.
I will do a little more research on my question and update here if you would like, but if you use tools such as Firefox's wave, you will see a structural error if you jump from h1 - h3, which is my reason of asking.
Thanks
Jason Anello
Courses Plus Student 94,610 PointsIt used to be that you might put your logo in an h1 for your homepage since that's the most important thing on your hp. Then on subsequent pages you would assign it to the main heading that described that page.
With html5 it's now ok to have multiple h1's. You can't put them anywhere you want though. They should be inside elements like <section> and <article>. There's certain conventions you should follow which you can do more research on.
I haven't read anything on skipping headings but I would think it would mess up your document structure.
Do you have a situation where you feel you need to skip one? Or just curious?
James Nelson
23,956 PointsJason Anello - its more for my own learning purposes than anything. Im still an XHTML guy so I have not used HTML5's section or article as of yet. But it does sound like a fantastic addition to HTML in general, I will definitely read up on this.
James Barnett - Thanks for sharing, problem solved :)