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 Styling Web Pages and Navigation Style the Portfolio

Jason Brown
Jason Brown
9,626 Points

Why 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

I 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.

readability is a factor too.

Jason Brown
Jason Brown
9,626 Points

Thanks 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
Aurelian Spodarec
10,801 Points

Well, 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
Jason Brown
9,626 Points

Sounds good. Thanks. I'll check out that link!

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Cool :) 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
Jason Brown
9,626 Points

I 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
Aurelian Spodarec
10,801 Points

I 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