I know this example is horizontal so far. But I intend to convert it to a horizontal once the vertical is complete. The problem is that I have menu items 3 levels deep. With the current code, when the user hovers over a menu item with sub-items, all subsequent levels appear. I'm trying to ensure maximum browser compatibility. And I'm also trying to minimize the need to use classes on every line.
HTML:
CSS:Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml" /> <title>Navigation Testing</title> <link rel="stylesheet" type="text/css" href="normalize.v2.1.0.css" /> <link rel="stylesheet" type="text/css" href="nav.css" /> </head> <body> <div id="webpage"> <div id="header"> <h1>Navigation Testing</h1> </div> <div id="vnav"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Tutorials</a> <ul> <li><a href="#">Photoshop</a></li> <li><a href="#">Illustrator</a></li> <li><a href="#">Dreamweaver</a> <ul> <li><a href="#">HTML</a></li> <li><a href="#">CSS</a></li> </ul> </li> </ul> </li> <li><a href="#">Articles</a> <ul> <li><a href="#">Web Design</a></li> <li><a href="#">User Experience</a></li> </ul> </li> <li><a href="#">Inspiration</a></li> </ul> </div> <div id="main"> <p>This is the main body of the page.</p> </div> <div id="footer"> </div> </div> </body> </html>
Thank you for any and all constructive input!Code:@charset "utf-8"; /* CSS Document */ ol, ul { list-style-type:none; } a { text-decoration: none; } #vnav li { display: block; border: solid 1px #000000; padding-top: 4px; padding-left: 4px; width: 80px; height: 20px; margin-bottom: -1px; } #vnav a { display: block; color: #006600; } #vnav a:hover { color: #009900; } #vnav ul li:hover { position: relative; background-color: #eeeeee; } #vnav ul li ul, #vnav ul li ul li ul { position: absolute; display: none; padding-left: 4px; } #vnav ul li ul li { width: 150px; } #vnav ul li:hover ul { display: block; left: 80px; }


Reply With Quote
Bookmarks