Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Basics Structuring Your Content Grouping Content with <main> and <div>

2 Answers

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.