+ 6

What is div tag? What is it used for?

What would happen if I don't use it? Is there any alternative to div tag?

20th Dec 2017, 3:39 AM
Maunang
Maunang - avatar
3 odpowiedzi
+ 11
Div is a block level element. use it when it doesn't make sense to use other elements. like for using a wrapper for other elements. Or to divide your content. Check below for more on the topic. PS: there are similar questions asked here before. search and read them in Q/A before posting.. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div http://mdn.beonex.com/en/HTML/Element/div.html
20th Dec 2017, 4:03 AM
Lord Krishna
Lord Krishna - avatar
20th Dec 2017, 5:30 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 3
https://code.sololearn.com/WdaMh3DaNw2s/?ref=app <div></div> = block element. All the block elements are alternative to div tag. will not float.
20th Dec 2017, 9:27 AM
Catty