Can someone help me solve issues with nested, hidden, vertical menu items “li ul”. The margin bottom works fine for top level only (<li>'s) yet when I try to create nested li’s they are not spacing properly, I do understand why, could someone point out a better way and where I am going wrong, the layout should space the nested li’s 5px for the second tier li’s also.
BTW, while I have you here, I have been able to remove the indentation for the unordered list and it appears to work fine in all browsers using “em’s”, is this the most precise method?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="mind,body,spirit,depression,gout,meditation,bioenergy" />
<meta name="description" content="A website dedicated to examining the holistic healing of the mind, body, spirit, connection." />
<title>The Wisdom of the Mind Body Spirit Connection</title>
<style type="text/css">
.menu {
width: 180px;
background-color: #C0C0C0;
}
.menu ul {
font-size:12px;
margin-left:-3.3em;
width: 180px;
}
.menu li {
list-style-type: none;
border-top: 1px white solid;
border-bottom: 1px white solid;
padding-top:3px;
padding-bottom:3px;
width: 179px;
background-color: purple;
text-align: center;
margin-bottom:5px;
-webkit-box-shadow: 0 8px 6px -6px black;
-moz-box-shadow: 0 8px 6px -6px black;
box-shadow: 0 8px 6px -6px black; /* For IE 8 */;
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000')"; /* For IE 5.5 - 7 */;
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=180, Color='#000000');
}
.menu a {
color: gray;
text-decoration: none;
display: block;
}
.menu a:hover {
color: white;
background-color: #3366CC;
}
.menu li ul {
display: none;
}
.menu li:hover > ul {
display: block;
margin-left:-3.3em;
}
.menu a {
color: #C46805;
text-decoration: none;
display: block;
}
.menu a:hover {
color:#F98A12;
background-color: #530CB4;
}
.menu li ul {
display: none;
}
.menu li:hover > ul {
display: block;
padding-top:3px;
padding-bottom:3px;
}
</style>
</head>
<body>
<div class="menu"><ul>
<li>
<a href = "#">Menu 1</a>
<ul>
<li>
<a href = "#">Sub Menu 1</a>
</li>
</ul>
</li>
<li><a href = "#">Menu 2</a>
<ul>
<li>
<a href = "#">Sub Menu 2</a>
</li>
</ul>
</li>
<li><a href = "#">Menu 3</a>
<ul>
<li>
<a href = "#">Sub Menu 3</a>
</li>
</ul>
</div>
</body>
</html>