I'm having trouble hiding a portion of my menu. Whenever I use the display:none
property, the entire menu disappears. I have assigned IDs to different elements to distinguish them, so I'm not sure why this is happening. Here's the code snippet:
HTML:
<ul id="menu">
<li><a href="#">Categories 1</a>
<ul id="cat1">
<li><a href="#">temp1</a></li>
<li><a href="#">temp2</a></li>
<li><a href="#">temp3</a></li>
</ul>
</li>
</ul>
CSS:
#menu {
background-color: #0000FF;
height: 20px;
padding: 15px 0 10px;
margin-bottom: 20px;
font: 12px 'DroidSansBold', Tahoma,sans-serif;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
box-shadow: 3px 2px 3px #000;
border-radius: 5px;
text-align: center;
}
#menu li{
display: inline-block;
}
#menu li a {
color: #fff;
text-decoration: none;
margin: 0 120px;
}
#cat1 li{
display: block;
padding: 10px;
}
#cat1 li a{
background-color: #0000FF;
padding: 10px;
border-radius: 5px;
}
Check out a somewhat functioning demo here: http://jsfiddle.net/ZfN7t/