Tell us what’s happening:
So, I was very curious to know why this snippet of code (and all the others) use a div container. I previously searched for why a div container is useful and got back that it can handle more sophisticated styling, but I’m still very confused. Why give them classes and id’s? Does it neaten the code?
All the elements have a definitive purpose.
Text - p, abbr, b, s, i, sup, sub, etc
Table - table, tr, td, th, thead, tbody, etc
Form - button, input, label, etc.
Sementic - main, section, header, footer, etc.
Div doesn’t have a definitive purpose, you can use it for basically anything if you know how to modify it in CSS and JS. Use it for styling, use it as layout container, use it as an output box. Whatever you can think of.
Also worth mention that span is similar to div, it allow you to motivate in between content to insert styling.
<p>For example, a sentence <span style="font-size:50px">with font size 50px big.</span></p>