HTML: <div> explanation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

HTML: <div> explanation

I've been helping people out with many Languages for a while now, but there's​ always one question where I answer "It's a block element where you can control other elements in it" leaving them even more confused. How do you properly explain what a <div> element does?

3rd Oct 2017, 8:24 AM
Limitless - avatar
6 Answers
+ 13
The <div> tag defines a division or a section in an HTML document, it is used to group elements to format them with CSS. Example: <div style="color:green">   <h1>This is a heading</h1>   <p>This is a paragraph.</p> </div> The text in <h1> and <p> are green.
3rd Oct 2017, 9:10 AM
Trưởng Nguyễn
Trưởng Nguyễn - avatar
+ 11
It is a container for other elements and objects that you can use it to refer to all other elements inside it or you can refer and style or change other elements in it And it acts as a block or box that can hold any type of data or information....!!
4th Mar 2018, 8:16 AM
Genes Sambayena
Genes Sambayena - avatar
+ 8
I'm not really sure whether this be a correct answer nor would it help by explaining, this is just my personal view, others may have different points & views on this matter. A div is an element that provides support for dividing the HTML document content into smaller views, or creating invisible areas that can be shown as necessary. Basically it's something that supports page content division, hence the name "div"? Hth, cmiiw
3rd Oct 2017, 9:10 AM
1st Oct 2018, 2:32 PM
Vučko/Вучко/Vuchko - avatar
+ 3
post it into Playgrounds, then ask your question in the QnA section with your code's link. @Muaffak ADLI
23rd Feb 2018, 5:00 PM
Limitless - avatar
- 2
l kill you
23rd Feb 2019, 7:53 AM
dimasbro - avatar