Reputation: 33
So I have been practincing CSS and html, and so far I haven't been able to fix this. Basically the button shows some white space below the image in the dropdown menu. I have the code here
HTML
<ul id="nav" class="drop">
<! Boton de Inicio>
<li id="main">
<img src="http://i.imgur.com/6PmX8Bw.png" border="0" height="50px" width="66px" style="top:3px; z-index:1;" />
<ul>
<li><a id="drop1" href="mensaje_content.html" target="_self">Mensaje del presidente</a></li>
<li><a id="drop1" href="pasos_en_verde.html" target="_self">Lo más destacado</a></li>
<li><a id="drop1" href="perfil_Org.html" target="_self">Perfil de la Organización</a></li>
<li id="seleccionada"><font color="#5AAF92">Gobierno corporativo</font></li>
<li><a id="drop1" href="BaBF.html" target="_self">Brindando un mejor futuro</a></li>
<li><a id="drop1">Análisis stakeholders</a></li>
</ul>
</li>
</ul>
CSS
ul#nav {margin: -2px;}
ul.drop a { display:block; color: #058052; font-family: Verdana; font-size: 14px; text-decoration: none;}
ul.drop, ul.drop li, ul.drop ul { list-style: none; margin: 0; padding: 0; border: 1px solid #058052; background: #fff; color: #058052;}
ul.drop { position: relative; z-index: 597; float: left; }
ul.drop li { float: left; line-height: 1.3em; vertical-align: middle; zoom: 1; padding: 5px 10px; }
ul.drop li.hover, ul.drop li:hover { position: relative; z-index: 599; cursor: default; background: #058052; color: #fff; }
ul.drop ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; width: 195px; background: #058052; }
ul.drop ul li { float: none; }
ul.drop ul ul { top: -2px; left: 100%; }
ul.drop li:hover > ul { visibility: visible }
ul.drop li a:hover{background: #058052; color: #fff;}
ul.drop li:hover>a {background: #058052; color: #fff;}
li#main {padding:0px; border: 0px; display: block; background:transparent; border-color:transparent; color:transparent; }
Upvotes: 1
Views: 1524
Reputation: 217
Try This(modified line 5 ul.drop.li)
line-height:0.3em
Replace Your code Put this one:
ul#nav {margin: -2px;}
ul.drop a { display:block; color: #058052; font-family: Verdana; font-size: 14px; text-decoration: none;}
ul.drop, ul.drop li, ul.drop ul { list-style: none; margin: 0; padding: 0; border: 1px solid #058052; background: #fff; color: #058052;}
ul.drop { position: relative; z-index: 597; float: left; }
ul.drop li { float: left; line-height: 0.3em; vertical-align: middle; zoom: 1; padding: 5px 10px; }
ul.drop li.hover, ul.drop li:hover { position: relative; z-index: 599; cursor: default; background: #058052; color: #fff; }
ul.drop ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; width: 195px; background: #058052; }
ul.drop ul li { float: none; }
ul.drop ul ul { top: -2px; left: 100%; }
ul.drop li:hover > ul { visibility: visible }
ul.drop li a:hover{background: #058052; color: #fff;}
ul.drop li:hover>a {background: #058052; color: #fff;}
li#main {padding:0px; border: 0px; display: block; background:transparent; border-color:transparent; color:transparent; }
Upvotes: 1
Reputation: 207891
Set the vertical-align property of the image to top:
img {
vertical-align:top;
}
Or set the image to display:block.
img {
display:block;
}
Note that in both examples the CSS will target all your images, so make the selector more specific to suit your needs.
Upvotes: 6
Reputation: 2142
li#main {
padding: 0px;
border: 0px;
display: block;
background: transparent;
border-color: transparent;
color: transparent;
height: 50px;
}
adding the height will fix
Upvotes: 3