Ver Mensaje Individual
  #11 (permalink)  
Antiguo 27/08/2009, 05:32
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 11 meses
Puntos: 539
Respuesta: problema con alineacion y estilos de menus

A ver si he entendido y acertado, Trevol.
Menú vertical alineado en la vertical con el principio del menú horizontal y algo mas de separación vertical entre las opciones del menú vertical.

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. #navcontainer {
  8. margin: 30px 0 0 150px;
  9. overflow: auto;
  10. }
  11.  
  12. ul#navlist {}
  13.  
  14. #navlist li  {
  15. display:table;
  16. float:left;
  17. height:4em;
  18. list-style-type:none;
  19. margin-right:15px;
  20. width:4em;
  21. }
  22.  
  23. #navlist a {
  24. display:table-cell;
  25. height:100%;
  26. position:relative;
  27. text-align:center;
  28. vertical-align:middle;
  29. text-decoration: none;
  30. color: #444;
  31. border: 1px inset #660;
  32. }
  33.  
  34. #navlist a:link.item1 {background: #ff0000;}
  35. #navlist a:link.item2 {background: #00ff00;}
  36. #navlist a:link.item3 {background: #0000ff;}
  37. #navlist a:link.item4 {background: #ffff00;}
  38. #navlist a:link.item5 {background: #ff3300;}
  39. #navlist a:hover {
  40. color:#ff3300;
  41. border: 1px outset #69f;
  42. }
  43.  
  44. #navlist a:hover.item1 {background: #ff0033;}
  45. #navlist a:hover.item2{background: #99ff00;}
  46. #navlist a:hover.item3{background: #0033ff;}
  47. #navlist a:hover.item4 {background: #ffff33;}
  48. #navlist a:hover.item5 {background: #ff6600;}
  49.  
  50. #navlist a:visited.item1 {background: #ff0000;}
  51. #navlist a:visited.item2{background: #00ff00;}
  52. #navlist a:visited.item3 {background: #0000ff;}
  53. #navlist a:visited.tem4 {background: #ffff00;}
  54. #navlist a:visited.item5{background: #ff3300;}
  55.  
  56. .contenedor {
  57. clear: both;
  58. margin: 15px 0 0 150px;
  59. }
  60. h1 {margin: 10px 0 0;}
  61. #cabezeras { margin: 50;50;50;}
  62.  
  63. .menuvertical{
  64. list-style: none;
  65. }
  66. .menuvertical li {
  67. margin:7px 0;
  68. width:60px;}
  69.  
  70. .menuvertical li a { text-decoration: none;
  71. padding: 5px 10px 5px 0;
  72. display: block;
  73. }
  74.  
  75. .menuvertical a:link.item6 {color: #ff0000; font-family:fantasy; font-style:oblique; font-size:20px; font-weight:200;}
  76. .menuvertical a:link.item7 {color:#9966CC;font-family:fantasy; font-style:oblique; font-size:20px; font-weight:200;}
  77. .menuvertical a:link.item8{color: #0000ff;font-family:fantasy; font-style:oblique; font-size:20px; font-weight:200;}
  78. .menuvertical a:link.item9 {color: #ffff00;font-family:fantasy; font-style:oblique; font-size:20px; font-weight:200;}
  79. .menuvertical a:link.item10 {color: #ff3300;font-family:fantasy; font-style:oblique; font-size:20px; font-weight:200;}
  80.  .menuvertical a:hover {
  81. color:#ff3300;
  82. border: 1px outset #69f;
  83. }
  84.  
  85. #navlist a:hover.item6 {background:ff0033;}
  86. #navlist a:hover.item7 {background: #99ff00;}
  87. #navlist a:hover.item8 {background: #0033ff;}
  88. #navlist a:hover.item9 {background: #ffff33;}
  89. #navlist a:hover.10 {background: #ff6600;}
  90.  
  91. #navlist a:visited.item6{background: #ff0000;}
  92. #navlist a:visited.item7 {background: #00ff00;}
  93. #navlist a:visited.item8 {background: #0000ff;}
  94. #navlist a:visited.item9 {background: #ffff00;}
  95. #navlist a:visited.item10 {background: #ff3300;}
  96. #cabezeras { margin: 50;50;50;}
  97. </head>
  98. <div id="navcontainer">
  99.   <ul id="navlist">
  100.     <li><a class="item1" href="#"> 1</a></li>
  101.     <li><a class="item2" href="#" >2</a></li>
  102.     <li><a class="item3" href="#">Item three</a></li>
  103.     <li><a class="item4" href="#">Item four</a></li>
  104.     <li><a class="item5" href="#">Item five</a></li>
  105.   </ul>
  106. </div>
  107. <div class="contenedor">
  108.   <h1> el texto Empieza aquí</h1>
  109.   <div class="menuvertical">
  110.     <ul class="menuvertical">
  111.       <li ><a class="item6" href="#" >iten 1 </a></li>
  112.       <li><a class="item7" href="#">iten 2</a></li>
  113.       <li><a class="item8" href="#">iten 3</a></li>
  114.       <li><a class="item9" href="#">iten 4</a></li>
  115.       <li><a class="item10" href="#">iten 5</a></li>
  116.     </ul>
  117.   </div>
  118. </div>
  119. </body>
  120. </html>

Pero sigues sin corregir los errores del html (div sin cerrar y etiqueta <body> innecesaria justo antes del cierre de </body>. Corrige también algunas cosillas del css. No lo he mirado más que en las propiedades que influían en el tema de la colocación.

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

Última edición por kseso?; 27/08/2009 a las 05:47