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 trialLearning coding
Front End Web Development Techdegree Student 9,937 PointsWhat'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
20,364 PointsHey 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.
Learning coding
Front End Web Development Techdegree Student 9,937 PointsUntil now I used a lot of div's, this will make it easier to read. Thanks!