Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: ul vs nested divs
09-05-2010, 06:58 AM #1
- Join Date
- Jul 2010
- Thanked 0 Times in 0 Posts
ul vs nested divs
When I create navigation menus, I typically have html markup this way:
<div><a href="#">Link 1</a></div>
<div><a href="#">Link 2</a></div>
<div><a href="#">Link 3</a></div>
I found many people use ul instead:
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
Both work after some styling, are there advantages using ul ? I believe it's the more popular way, but to me ul needs more works like hiding the bullets and taking away margins and paddings.
Last edited by mattshiao; 09-05-2010 at 07:01 AM. Reason: typo
09-05-2010, 10:42 AM #2
- Join Date
- Mar 2007
- Thanked 2,224 Times in 2,211 Posts
Navigation menu is basically a "list" of of links and thus using a list would be more semantic than using passive <div> elements, which do not imply anything to the document. If it's a list, then it'll be rendered with some structure by the browser, even if there's no CSS applied.
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)