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

Step 2 Question

In this video I notice that the h2 tag is not within the div tag.

1) Does it matter if the h2 tag is placed outside or within the div tag?

2) Would having h2 within div be better as a "container"?

2 Answers

I'm not sure exactly which video you are referring to, but it shouldn't matter presentationally if the h2 tag is inside of the container div. Semantically, of course, it might be better to put all of your content inside of the container, but it shouldn't affect whether or not the header appears on the page, especially if you did a CSS reset with normalize.css or the likes.

Hope that helps!

– J.

Hi Goh:

Both an h2 and a div are going to be block elements, so it probably make any difference unless you just want to organize them by placing the h2 inside your div.