Could you explain <div> tag? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Could you explain <div> tag?

23rd Jul 2017, 6:24 PM
Bala
Bala - avatar
2 Answers
+ 3
In practice it is often used as a container/organizer for other elements on the page, imagine a website as a bunch of squares and rectangles containing other elements that make up the page as a whole, the squares and rectangles are usually denoted as <div> tags. HTML semantic elements are just more descriptive <div> tags to make the page more human readable. (CSS Grid or 3rd party Grid systems are much better imo.)
23rd Jul 2017, 6:30 PM
Frank Gunsch
Frank Gunsch - avatar
+ 2
The div tag is a block level element and is used to group related items together. For example, if you were making a contact page with a name field, an email field and a message field you could group them together.
23rd Jul 2017, 6:31 PM
Thomas John
Thomas John - avatar