Welcome to the Treehouse Community
Looking to learn something new?
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.