You may have seen the Pure CSS Menus demo on Eric Meyer’s css/edge, it has been around for a while. The premise: pure CSS menus, no scripting necessary. The catch: they don’t work in Internet Explorer.
Well, not so fast. Thanks to Peter Nederlof, with a slight bit of script-based tweaking you can work around this. See his explanation and demo page. (box model errors plague the latter, which means IE5 won’t display the style as intended, although it should demonstrate the behaviour regardless)
What makes this solution better than complex DHTML-based menus? Structure, baby, structure. View the source XHTML for a quick peek at the simple list of <ul>
and <li>
elements. The result: a clean separation of content and presentation, semantically proper code and generally accessible menus.