+ 1
Classes and DIV?
I am completely confused about what the DIV tag and what the Class attribute does. I am fairly new to HTML coding, so i am stuck...
1 Answer
+ 14
The first one is a generic tag used to group set of elements, in HTML5 you can use the semantic element: <section>.
The second one is a global attribute (you can use this attribute on any HTML tag) used to assign one or more classes in one or more elements to assign style or use them in Javascript, the main advantage to use classes is that you can use as many classes as you need in all elements you want without any kind of limitation, then you can easily assign CSS rules at one or more elements.
Still stuck on this stuff? No problem, try to use the search bar and see if someone else already posted something about:
https://www.sololearn.com/Discuss/191880/?ref=app
https://www.sololearn.com/Discuss/21748/?ref=app ...