The sub-menu items under the about link appear to be slightly shifted from the left, despite setting it with position: absolute; left: 0px
.
I aim to have all menu items (including sub-menus) perfectly overlapped. Below is the code snippet:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
.nav{
position:relative;
}
#menu {
position:absolute;
left:0px;
margin: 0;
padding: 0;
}
#menu ul{
position:absolute;
left:0px;
list-style: none;
}
#menu li {
line-height:40px;
font: 100%;
font-family:Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
background: #333333;
border-bottom:#444444 thin solid;
}
#menu a {
color: #CCCCCC;
text-decoration: none;
margin: 0;
padding: 8px 12px;*/
text-decoration: none;
font-weight:bold;
}
#menu a:hover {
color: #fff;
padding-bottom: 8px;
}
</style>
</head>
<body>
<div class="nav">
<ul id="menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">Bio</a></li>
<li><a href="#">Blog</a>
<ul>
<li><a href="#">Blogger Blog</a></li>
<li><a href="#">Wordpress Blog</a></li>
<li><a href="#">Other</a></li>
</ul>
</li>
<li><a href="#">Hobby</a></li>
</ul>
</li>
<li><a href="#">Gallery</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</body>
</html>