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
Anwar RizalmanPython Development Techdegree Graduate 33,620 Points
Whats the difference between div and section?
I feel like these two element tags are the same thing.
During the video where Guil introduced the <section> element, he said "The section element groups together related sections of content, like a group of blog entries, news articles, or video.". So, as Jacob said, this is the semantic associated to the <section> element. The semantic is important for the use of search engines, accessibility software like screen readers, and others.
By contrast, <div> has no semantic associated to it at all. It's just a container to wrap up bits of your code and it's mainly used for styling those bits of code you are wrapping up with <div>. So, the real usefulness of the <div> is going to be in the CSS file. You will most likely create different <div> elements across your HTML pages with different IDs and/or classes to be called and styled in the CSS .
They work the same the only difference is section is HTML5 and provides more semantics in your markup.