html - CSS issue, dropdown menu showing white space -
so have been practincing css , html, , far haven't been able fix this. button shows white space below image in dropdown menu. have 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 { 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; }
set vertical-align property of image top:
img { vertical-align:top; }
or set image display:block.
img { display:block; }
note in both examples css target images, make selector more specific suit needs.
Comments
Post a Comment