Is the div tag just a way to section/organize your code? I'm not exactly sure what its use is. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is the div tag just a way to section/organize your code? I'm not exactly sure what its use is.

for people familiar with Photoshop, would the div tag be equivalent to grouping layers? for example, when you group layers in a folder, not only does it keep similar layers together, but also you can mass edit those layers by editing the folder or focus on the individual layers within the folder. In html, would the div tag be the folder in this scenario?

8th Jun 2018, 5:51 PM
Marquise Miranda
Marquise Miranda - avatar
3 Answers
+ 4
Not exactly, as the div can still contain other elements that can be edited separately. But it is sort of a container, and is a sectioning content element. Check out the tutorial on the div for a thorough explanation. Cheers!
8th Jun 2018, 5:56 PM
Tony
Tony - avatar
+ 1
it's used just like how i thought then. thanks for the clarification!
8th Jun 2018, 5:59 PM
Marquise Miranda
Marquise Miranda - avatar
+ 1
Great! Happy to help. Cheers!
9th Jun 2018, 1:27 AM
Tony
Tony - avatar