For what purpose i should use <div id="menu"> </div> | Sololearn: Learn to code for FREE!


For what purpose i should use <div id="menu"> </div>

Thanks for explaining..

3/16/2017 6:13:12 AM

Md Wasim Ali Ansari

3 Answers

New Answer


you only make a div, and give it an I'd menu, this visually does nothing, unless there is content inside this div, since div is a block level element, there will be a empty line on top and under your text if you want to make a menu, you should make it inside the navigation tags(<nav></nav>)


I use div for making squares and rectangles as using SVG again and again can be quite tough and long but by using div or span( kind of inline div) making parts of websites becomes an easy job. My code Happy Android is made using mainly div.


This is used to give a unique identifiant to your div, for exemple, when using jquery , you need to do it in order explain to jquery that you want to edit the div with "id=menu".