For what purpose i should use <div id="menu"> </div> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

Thanks for explaining..

16th Mar 2017, 6:13 AM
Md Wasim Ali Ansari
Md Wasim Ali Ansari - avatar
3 Answers
+ 10
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>)
16th Mar 2017, 6:20 AM
Kamil
Kamil - avatar
+ 7
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.
16th Mar 2017, 6:57 AM
Utkαrsh
Utkαrsh - avatar
+ 2
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".
16th Mar 2017, 6:21 AM
Salim Bounceur
Salim Bounceur - avatar