User Experience
CSS tabs with Submenus
Freshness Warning
This blog post is over 21 years old. It's possible that the information you read below isn't current and the links no longer work.
15 May 2003
There’s lots of talk recently about creating tabbed menus with CSS, but very little about associating submenus to the tabs. Joshua Kaufman and Richard Rutter have done it, but their methods require the creation of separate unordered lists that are only associated with the parent menu by the CSS. If you view the page without the stylesheet — with a screen reader for example — the navigation is confusing and impossible to decipher.
I created a method of adding submenus to your tabbed navigation in which the submenu lists are nested into the parent navigation list list. So anyone not using CSS will see a menu that looks like…
- Home
- About Us
- People
- Careers
- …
- Contact Us
- …
… and everyone else will see a tabbed menu like …
I’ve put up a demo page for your enjoyment.
Update: I forgot to mention: please feel free to use the code and mangle or adapt it as needed. If you use it would be nice if you’d tell me where. I’m just curious where it ends up.