Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML site development: div's vs ul's for navigation and menus

I'm working on developing a Web 2.0 site, and I've been looking at how sites deal with menus and nav-bars. Many sites (like twitter) use UL's whereas sites such as stackoverflow use div's that are ID's containing links.

Is there an advantage to not using UL's other than it eliminates some IE bugs?

is there an advantage to using UL's?

Thanks!

like image 606
Ryan Rohrer Avatar asked May 06 '09 07:05

Ryan Rohrer


1 Answers

It depends on how you look at it, UL stands for unordered list. Putting things in a UL element is a semantic way of saying the elements children ( <li> ) are list items and therefore a logical group. Which gives the chunk of html more structure/meaning than just a bunch of div tags.

Is a menu a list? I think so. So if you can for something like this prefer the ul.

ul's can be more difficult to style with css, especially when the menu is horizontal.

like image 172
Chad Grant Avatar answered Oct 19 '22 23:10

Chad Grant