What <div> or </div> tag and for what and why it is used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What <div> or </div> tag and for what and why it is used?

6th Apr 2018, 4:34 PM
Hax max
Hax max - avatar
4 Answers
+ 2
It makes "block". For example if you have article then you want to have block with header of article and block with content then you will probably do: <article> <div> Title </div> <div> Content of article. </div> </article> It is useful for identify block from website in CSS sheets. You can make <div id="headofarticle"></div> and make visual concept of this block in CSS only for this div. #headofarticle { color: #FFFFFF }
6th Apr 2018, 4:40 PM
Bartosz Pieszko
Bartosz Pieszko - avatar
+ 2
what is full form of div tag
6th Apr 2018, 4:42 PM
Hax max
Hax max - avatar
+ 2
There are a lot of options for div. I think (but not sure) the most valuable are id= and class= and maybe style= if you want to edit visual concept of it in html not CSS.
6th Apr 2018, 4:45 PM
Bartosz Pieszko
Bartosz Pieszko - avatar
0
check this as a sample of using div https://code.sololearn.com/WNvSp3Q9S5GD/?ref=app
6th Apr 2018, 7:05 PM
🇮🇷 M N