+ 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?
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
+ 6
https://www.sololearn.com/discuss/924266/?ref=app
https://www.sololearn.com/discuss/713328/?ref=app
https://www.sololearn.com/discuss/898114/?ref=app
+ 3
https://code.sololearn.com/WdaMh3DaNw2s/?ref=app
<div></div> = block element. All the block elements are alternative to div tag. will not float.