Div in HTML | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Div in HTML

What's the function of div tag in html? i don't really understand them

20th Mar 2018, 1:04 PM
Vincent
Vincent - avatar
2 Answers
20th Mar 2018, 1:27 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 2
Div is a division element, and really serves no special purpose than to be a blank canvas. In HTML, nearly all other tags are used for one specific thing (ie. <img> is used for images, etc.), but the div doesn't exactly have one specific purpose, and can be tweaked to your liking in CSS. It's basically just used as an alternative if there's a tag that you want to use that doesn't exist, so that you can make it yourself. Hope this helped!
20th Mar 2018, 1:10 PM
Faisal
Faisal - avatar