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

Learning coding
Learning coding
Front End Web Development Techdegree Student 9,937 Points

What's the difference between <section>, <p>, <div container>, or <div wrapper>?

Isn't it all for breaking up groupings of information? I see these different code's when I watch the video's here, or tutorials in youtube and would like to have more clarity in this.

2 Answers

nico dev
nico dev
20,364 Points

Hey very good question really! And the answer (only in my humble opinion, although there will surely be more and better replies) is: basically, yes, although due to different criteria.

I will explain what I mean: the way I see it, you use the <section> to distinguish the section from others, like the header, the footer, etc. However, even inside of that section, you may have a couple of <div>s. Why? Because you want to style them differently (or make them look at the side of each other, clearing them right and left, for example). Even inside of each of these <div>s, you may have more than one <p>, and this is again not stylistic, but rather to simple put one paragraph of the div apart from the other.

So there you have an example, where you would use a <section>, then inside a couple of <div>s, and inside each of them, more than one <p>.

Hope that helped.