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 trialJason Brown
9,626 PointsWhy choose the <div> instead of the <section> for the "wrapper" ID? Is there a difference?
From what I can tell the <div> and the <section> tags are serving the same purpose? Was this used as an example on how to use the <div> tag? If so, are there other purposes for the <section> tag? If this wasn't a lesson, would there be use cases to have both?
4 Answers
Matthew Garza
26,312 PointsI think its a matter of preference and both are acceptable. People prolly use the section in their code for a more uniformed look to their code. Like if i had different sections in my code for a form I would use<sections> but if I were just throwing code together i would just use divs.
Jason Brown
9,626 PointsThanks Matthew. I kind of figured, but since code has to be so precise, I just wanted to make sure.
I also have a question about the "wrapper" ID vs. the "Gallery" ID. They are separated to provide the structure vs. the styling and also to give clarity in the CSS? Would it be possible to style the portfolio within the "wrapper" ID?
Aurelian Spodarec
10,801 PointsWell, actually, my guess it that the video is about 3years old, and HTML5, because section is a new element tag, was not valid yet.
HTML5 was released on 28 October 2014. The video is definitely older than 2years.
You should checkout HTML5 tags here http://www.w3schools.com/html/html5_semantic_elements.asp and look for more.
Start using HTML5 straight away, since that's required in todays day. You won't see a web professional using div for header, or div for footer with id of footer and header, same with article, just no.
Hope that helps.
Jason Brown
9,626 PointsSounds good. Thanks. I'll check out that link!
Aurelian Spodarec
10,801 PointsCool :) Hey, are you new? Want to join slack channel? Anyone is welcome. We work on project and stuff like that, help each other etc..
Jason Brown
9,626 PointsI am new. I appreciate the offer! I can't wait till I'm the one answering other people's questions.
What's the name of the Slack channel? I used Slack at my last job. My username was @jason.brown, but perhaps that was within our org? I'm sure there are others with the same username?
Aurelian Spodarec
10,801 PointsI need your email so I can send you the invite. I didn't yet figure out how to get the API for people so sign them selfs up. ANd that's intresting, what did you do before? :D
Matthew Garza
26,312 PointsMatthew Garza
26,312 Pointsreadability is a factor too.