Weird CSS/Nav Blank Space
Hello stack overflow community we meet again. I create this two leveled Navigation bar with CSS and i got everything to work but for one little issue, there a blank space that i can't seem to get rid of
Here is the Html
<ul id="nav-top">
<li><a href="default.asp">Home</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">Join TGA</a></li>
</ul>
<img src="wp-content/themes/tga/pictures/topbanner.jpg" id="top-banner" />
<div id="header">
<ul id="nav-bottom">
<li><a href="#">Percoidei</a>
<ul>
<li><a href="#">Remoras</a></li>
<li><a href="#">Tilefishes</a></li>
<li><a href="#">Bluefishes</a></li>
<li><a href="#">Tigerfishes</a></li>
</ul>
</li>
<li><a href="#">Anabantoidei</a>
<ul>
<li><a href="#">Climbing perches</a></li>
<li><a href="#">Labyrinthfishes</a></li>
<li><a href="#">Kissing gouramis</a></li>
<li><a href="#">Pike-heads</a></li>
<li><a href="#">Giant gouramis</a></li>
</ul>
</li>
And here is the CSS
#nav-bottom{
list-style-type:none;
height: 34px;
margin:0;
padding:0;
overflow:hidden;
background-image: url(pictures/nav-graphic.png);
line-height: 2;
}
#nav-bottom li:hover {
list-style-type:none;
height: 34px;
margin:0;
padding:0;
overflow:hidden;
line-height: 2;
background-color: #494949;
color: white;
}
#nav-bottom li{
float:left;
}
#nav-bottom a{
display:block;
width:100px;
text-decoration: none;
color: black;
}
#nav-bottom li ul {
position: absolute;
width: 10em;
left: -999em;
list-style-type:none;
background-color: #494949;
color: white;
}
#nav-bottom li ul li a {
color: white;
width: 10em;
开发者_如何转开发 border-bottom:1px solid white;
}
#nav-bottom li ul li a:hover {
color: white;
width: 10em;
background-color: #2a2a2a;
text-align: left;
border-bottom:1px solid white;
}
#nav-bottom li:hover ul {
left: auto;
}
Here is what it looks like
look at link bellow (sorry don't have the rep points to upload the picture)
What am i doing wrong that causing that blank space?
Ok here is the blank space i'm talking about http://i52.tinypic.com/dcsg9j.png
And I uploaded it to jsfiddle (cool dev site love it) and it works fine in there, do you think is a problem with my browser (chrome 14.0.835.163 running on mac) it also does the blank space in firefox? http://jsfiddle.net/donvito101/ZWeVq/
I guess you mean that blank space that indents the submenu ? In this case it's propably because you are starting a new in the submenu, which is always indented. Put a few px negative padding (or margin?) for #nav-bottom ul and you should be good! e.g.
#nav-bottom ul { padding-left: -15px; }
精彩评论