Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/10/2009, 14:51
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: Ayuda para posicionar imagen dentro (o sobre) menú

Hola Loiserl
Me he permitido hacer algún cambio a tus códigos.
No se si será lo que andas buscando:
Código html:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
  3. <title>Kseso? jugando con css</title>
  4. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
  5. <style type="text/css">
  6. * {margin: 0; padding:0; outline: none; border: 0;}
  7. body, html {
  8.     background-color: #fff;
  9.     height: 100%;
  10.     width: 100%;
  11. }
  12. #nav {
  13. /*    margin:0;
  14.     padding: 0 0 20px 10px;*/
  15.     background: #444 url(menu_bg.jpg) repeat-x;
  16.     }
  17.  
  18. html>body #nav {
  19.     /*padding: 0 0 38px 0px;*/
  20.     }
  21.  
  22. #nav li {
  23. /*    margin: 0;
  24.     padding: 0;
  25.     display: inline;*/
  26.     float: left;
  27.     list-style-type: none;
  28.     }
  29.    
  30. #nav a:link, #nav a:visited {
  31. /*    float: left;*/
  32.   display: block;
  33.   background: #444;
  34.     font-size: 18px;
  35.     line-height: 38px;
  36.     font-weight: bold;
  37.     padding: 10px 32px;
  38.     text-decoration: none;
  39.     color: #FFF;
  40.     }
  41.  
  42. #nav a:link.active, #nav a:visited.active, #nav a:hover {
  43.     color: #FFF;
  44.     background: #cdcdcd;
  45.     }
  46. #nav a#flag:link.active, #nav a#flag:visited.active, #nav a#flag:hover {
  47.   background: #444;
  48. }
  49.  
  50. #flag {
  51. /*    margin-bottom:50px;
  52.     padding: 0 0 20px 10px;*/
  53.     }
  54. </head>
  55. <ul id="nav">
  56.     <li><a href="index_en.htm">Inicio</a></li>
  57.     <li><a href="services_en.htm">Nuestros servicios</a></li>
  58.     <li><a href="#">Muestras</a></li>
  59.     <li><a href="customers_en.htm">Clientes</a></li>
  60.     <li><a href="contact_en.htm">Contacto</a></li>
  61.     <li><a id="flag" href="contact_en.htm"><img src="en.png" alt="bandera de idioma"/></a></li>
  62. </ul>
  63. </body>
  64. </html>
Como verás, al hacer hover sobre la imagen, su fondo no se altera. Añadí una definición más al css: #nav a#flag:link.active, #nav a#flag:visited.active, #nav a#flag:hover y el id lo aplico al enlace, no a la imagen.
No he tomado mucho punto en las medidas de cada "a" que se las da el padding. Ajusta a tus necesidades, igual que los fondos.

Un saludo
__________________
Por una web con mucho estilo
+++ CUENTA ABANDONADA. ¿la quieres? +++