html - Turning navigation bar into a drop down navigation -
i'm trying edit code when hovers on products, drop down , show different sub categories, want display 4 options, 450, 250, 2 strokes , junior.
here html:
<link rel="stylesheet" type="text/css" href="website.css"> <font face="tahoma"> <font color="lightgray"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style type="text/css"> body { font-family: verdana, helvetica, sans-serif; font-size: 20px; } .horizontal_menu { display: inline; text-align:center; border: 1px lightgray; background-color: white; opacity: 0.5; filter: alpha(opacity=50); margin: 2px; border: 2px solid #a1a1a1; padding: 5px 20px; width: 800px; border-radius: 10px; } .horizontal_menu li { text-align:center; display: inline; list-style: none; margin: 5px; } .horizontal_menu li { text-decoration: none; color: black; } .horizontal_menu li a:hover { text-decoration: underline; } </style> </head> <body> <center> <ul class="horizontal_menu"> <li> <a href="homepage.php" title="back home page">home</a> </li> <li> <a href="products.php" title="check out products in stock">products</a> </li> <li> <a href="aboutus.php" title="check out products in stock">about us</a> </li> <li> <a href="contact.php" title="check out products in stock">contact</a> </li> </center> </ul> </body> </html> <?php ?>
and css:
body { background-image: url("http://p1.pichost.me/i/5/1282860.jpg"); background-size: cover; } h2 { color: lightgray; margin-left: 5px; } legend { display: block; padding-left: 2px; padding-right: 2px; border: none; } div { border: 2px solid #a1a1a1; padding: 10px 40px; background #dddddd; width: 300px; border-radius: 25px; } { list-style:none; list-style-type:none; }
thanks in advance!
nest second list inside first, below example of how works. here fiddle completed example:
html:
<ul class="horizontal_menu"> <li> <a href="homepage.php" title="back home page">home</a> <ul> <li>nested item</li> <li>nested item</li> <li>nested item</li> </ul> </li>
and add in css hidden nested items show on hover this:
css:
.horizontal_menu li > ul { display: none } .horizontal_menu li:hover > ul { display: block; }
the example used in fiddle taken site: http://line25.com/tutorials/how-to-create-a-pure-css-dropdown-menu
Comments
Post a Comment