Ver Mensaje Individual
  #9 (permalink)  
Antiguo 21/11/2010, 17:15
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: li dentro de a

Cita:
Iniciado por PedroDesing Ver Mensaje
Lo que gano con meter el li dentro y no al reves, es la superficie que consigo cambiar de color en el estado :hover, con el li puedo conseguir una superficie mayor usando padding y tal incluso meter una img con background en el hover del li.
Esta parte se me pasó
No tiene porqué dar medidas al li, ni es recomendable.
Es preferible que sea el propio enlace el que marque el tamaño, y así toda la superficie recibe el foco
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" xml:lang="es" lang="es-es">
  3. <title>Kseso? jugando con css</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  5. <style type="text/css">
  6. * {margin:0; padding:0; outline: none; position: relative;}
  7. html, body {
  8.   height: 100%;
  9.   background: #f5f5f5;
  10.   font-size: 1em;
  11.   font-family: garamond, serif;
  12. }
  13. ul {list-style-type: none;}
  14. ul li {float:left; border: 1px solid #CC0000; margin: 0 5px;}
  15. ul li a {display: block; padding: 50px 200px; background: #f5f5f5; color: #444; text-decoration: none;}
  16. ul li a:hover {background: #444; color: #f5f5f5;}
  17. </head>
  18.   <ul>
  19.       <li><a href="#">Enlace 1</a></li>
  20.       <li><a href="#">Enlace 1</a></li>
  21.   </ul>
  22. </body>
  23. </html>
Fíjese que son los li los que tienen el borde, pero no tienen asignado nada que relativo al tamaño.