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
Haley Young
14,315 PointsShould we be using <section> instead of <div>?
I've always thought that section is the more semantic choice in many cases, but Nick seems to be using a lot of divs here. Is this more of a preference thing or is there a clear better option?
3 Answers
Ethan Rivas
9,979 PointsIt's All About Semantics:
The SECTION element is defined as a semantic section of a web page or site that isn't another more specific type (like article or aside).
The DIV element is used for parts of the page that you want to divide up, but for purposes other than semantics.
You can read more about this here: http://webdesign.about.com/od/html5tags/fl/div-vs-section.htm
Tracy Excell
Front End Web Development Techdegree Graduate 15,333 PointsHi, I found this, which may help you.
The <div> tag defines a division or a section in an HTML document. The <div> tag is used to group block-elements to format them with CSS.
In the HTML5 standard, the <section> element is defined as a block of related elements. The <div> element is defined as a block of children elements.Aug 4, 2011 html5 - What is the difference between <section> and <div>? - Stack ...
stackoverflow.com/questions/6939864/what-is-the-difference-between-section-and-div
Stephanie Marek
2,831 PointsThese replies were helpful. I don't think I fully grasped the functionality of semantic markups from this section, so more reading on their importance helped me to understand the difference between <section> and <div>.
"By using HTML tags that have meaning, you create pages that impart more information than by just surrounding everything with <div> tags." -https://www.lifewire.com/why-use-semantic-html-3468271
Haley Young
14,315 PointsHaley Young
14,315 PointsThis is in regards to this video: https://teamtreehouse.com/library/accessibility/websites/html-part-2
I thought I posted it under the video thread but it appears not; my apologies.