Welcome to WebmasterWorld Guest from 54.81.116.187

Forum Moderators: not2easy

Message Too Old, No Replies

CSS menu and nav bars.

How do you do it?

     
12:49 pm on Sep 18, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 29, 2007
posts:1147
votes: 0


I'm working with a site now which someone has asked me to modify. It has 2 menu bars, one along the top, and one down the side...

..Top 1....Top 2....Top 3....Top 4.... 
...........Drop 1............Drop 1...
...........Drop 2............Drop 2...
...........Drop 3.....................
......................................

...Side 1.... 
...Side 2....
.....Sub 1...
.....Sub 2...
...Side 3....
...Side 4....
.............

You get the idea.

Anyway, the markup seems a little bloated, DIV/UL/LI/A. And they're using Javascript for the dropdown menus, and it's not very well written as it keeps throwing hover errors at me!

Firstly, I was wondering how you guys did your menus? For a sidebar I've previously used just DIV/A..A..A etc, for a top menu I'll be honest, I'm still a fan of using tables for horizontal layout, mainly cos you can get things to bold without pushing the next element over, but is TABLE/TR/TD so different from DIV/UL/LI? ;)

Secondly can someone please give me a clear example of a PureCSS dropdown? I've looked on the web but so many examples have got hacks all over them for IE6 and below and the code really isn't well structured enough to follow without spending days on it.

Thanks in advance!

9:05 pm on Sept 18, 2008 (gmt 0)

New User

5+ Year Member

joined:Sept 18, 2008
posts:1
votes: 0


is TABLE/TR/TD so different from DIV/UL/LI?
Yes. It's the semantics of the code. A navigation menu has no meaning in a table structure, but it does in a list structure because a menu is really a list of places to go. The general argument is that using tables to structure the wrong kind of data makes your site less accessible and gadgets screen readers won't be able to read the site properly.

[edited by: tedster at 12:41 am (utc) on Sep. 19, 2008]