Drop down menu (vertical)
I needed to add a dropdown navigation menu to a website. I used a code that I found that I believe came from Nancy O and it worked well. However, I would like for it to be a vertical dropdown instead of horizontal. Do you know what I would change in the code? The site and code is below. Thanks.
CSS Code:
/* BEGIN HORIZONTAL DROP-MENU */
#navbar{
position:relative;
width: 100%;
margin: 0 0 0 45px; /**adjust as needed**/
padding:0;
text-align:center;
}
#navbar li {
list-style: none;
font-size: 12px;
float: left;
text-align:center;
}
/**top level menu**/
#navbar li a, #navbar li a:visited {
display: block;
text-decoration: none;
margin-right: 12px; /* space between links */
color: #FFF;
width: 9em; /* adjust as needed or use auto */
padding: 8px;
font-weight:bold;
line-height: 1.50em;
background: #C33;/* for older browsers */
/**CSS gradients for various browsers**/
background: -moz-linear-gradient(#C33, #111);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #111),color-stop(1, #C33));
background: -webkit-linear-gradient(#C33, #111);
background: -o-linear-gradient(#C33, #111);
background: -ms-linear-gradient(#C33, #111);
background: linear-gradient(#C33, #111);
/* gradient filters for IE6-9 */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C33333', endColorstr='#111111',GradientType=0 );
}
/**top menu style on mouse over**/
#navbar li:hover > a {
color: #FFF;
}
/**sub-menu**/
#navbar li ul {
display: none;
text-align:center;
margin:0;
padding:0 1em;
}
#navbar li:hover ul,
#navbar li.hover ul {
display: block;
position: absolute;
padding: 0;
}
#navbar li:hover li,
#navbar li.hover li {
float: left;}
/**drop-menu style**/
#navbar li:hover li a, #navbar li.hover li a {
color: #0D207D;
width: auto; /* adjust width as needed or use auto */
background: none;
filter:none:
}
/**drop-menu style on mouse over**/
#navbar li li a:hover {
color: #990000;
text-decoration:underline;
}
/* Clear floated elements at the end*/
#navbar:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
/**END HORIZONTAL DROP-MENUS STYLES**/
[an error occurred while processing this directive]
HTML Code:
<ul id="navbar">
<li><a href="#">ABOUT US ▼</a><ul>
<li><a href="#">Videos</a></li>
<li><a href="#">Newsletter</a></li></ul>
</li>
<li><a href="#">PRODUCTS ▼</a><ul>
<li><a href="#">Broken Glass</a></li>
<li><a href="#">Mosaic Tiles</a></li>
<li><a href="#">Adhesives</a></li>
<li><a href="#">Grout</a></li></ul>
</li>
<li><a href="#">ACCESSORIES ▼</a><ul>
<li><a href="#">Gloves</a></li>
<li><a href="#">Rubber Mallets</a></li>
<li><a href="#">Sponges</a></li>
<li><a href="#">Safety Glasses</a></li></ul>
</li>
<li><a href="#">CONTACT</a></li>
</ul> <!--end navbar-->
