Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/09/2013, 10:23
edgar4615
 
Fecha de Ingreso: agosto-2010
Mensajes: 202
Antigüedad: 13 años, 8 meses
Puntos: 4
Respuesta: Grupo de pestañas en la misma página

Buenas de nuevo, gracias por la ayuda.

Código CSS:
Ver original
  1. /* Set the size and font of the tab widget */
  2. .tabGroup {
  3.     font-family: 'Verdana',Helvetica,sans-serif;
  4.     font-size: .8em;
  5.     margin: 0 auto;
  6.     background: none repeat scroll 0 0 #F3F1EB;
  7.     border: 1px solid #DEDBD1;
  8.     padding: 10px;
  9.     width: 600px;
  10.     height: auto;
  11.     text-align: justify;
  12.     color: #385c5b;
  13. }
  14. :adios:
  15. .tabGroupTexto {
  16.     font-family: 'Verdana',Helvetica,sans-serif;
  17.     font-size: .8em;
  18.     margin: 0 auto;
  19.     background: none repeat scroll 0 0 #F3F1EB;
  20.     border: 1px solid #DEDBD1;
  21.     padding: 10px;
  22.     width: 600px;
  23.     height: auto;
  24.     text-align: justify;
  25.     color: #385c5b;
  26. }
  27.  
  28. .tabGroup > label {
  29.     cursor: pointer;
  30. }
  31.  
  32. /* Configure the radio buttons to hide off screen */
  33. .tabGroup > input[type="radio"] {
  34.     position: fixed;
  35.     left:-100px;
  36.     top:-100px;
  37. }
  38.  
  39. /* Configure labels to look like tabs */
  40. .tabGroup > input[type="radio"] + label {
  41.     /* inline-block such that the label can be given dimensions */
  42.     display: inline-block;
  43.  
  44.     /* A nice curved border around the tab */
  45.     border: 1px solid #DEDBD1;
  46.     border-radius: 5px 5px 0 0;
  47.     -moz-border-radius: 5px 5px 0 0;
  48.     -webkit-border-radius: 5px 5px 0 0;
  49.  
  50.     /* the bottom border is handled by the tab content div */
  51.     border-bottom: 0;
  52.  
  53.     /* Padding around tab text */
  54.     padding: 5px 10px;
  55.  
  56.     /* Set the background color to default gray (non-selected tab) */
  57.     background-color:#ddd;
  58. }
  59.  
  60. /* Focused tabs need to be highlighted as such */
  61. .tabGroup > input[type="radio"]:focus + label {
  62.     border:1px dashed #DEDBD1;
  63. }
  64.  
  65. /* Checked tabs must be white with the bottom border removed */
  66. .tabGroup > input[type="radio"]:checked + label {
  67.     background-color:white;
  68.     font-weight: bold;
  69.     border-bottom: 1px solid white;
  70.     margin-bottom: -1px;
  71. }
  72.  
  73. /* The tab content must fill the widgets size and have a nice border */
  74. .tabGroup > div {
  75.     display: none;
  76.     border: 1px solid #DEDBD1;
  77.     background-color: white;
  78.     padding: 10px 20px;
  79.     height: 81%;
  80.     overflow: auto;
  81.     margin-top: -1px;
  82.  
  83.     border-radius: 0 5px 5px 5px;
  84.     -moz-border-radius: 0 5px 5px 5px;
  85.     -webkit-border-radius: 0 5px 5px 5px;
  86.  
  87.     box-shadow: 0 -2px 3px -2px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.1);
  88. }
  89.  
  90. .tabGroup > div img {
  91.     float: right;
  92.         padding-left: 15px;
  93.     /*border: 1px solid black;*/
  94. }
  95.  
  96.     /* This matchs tabs displaying to thier associated radio inputs */
  97.     .tab1:checked ~ .tab1, .tab2:checked ~ .tab2, .tab3:checked ~ .tab3 {
  98.         display: block;
  99.     }

Este es el único css al que llamo... ya he probado el orden label input .tab y el adyacente + en el css y no me dibuja bien los tabs.

La idea es no tener que repetir los ids en los inputs, sino de alguna forma tener un tabGroup1 (rad1,rad2...), tabGroup2(rad1,rad2...) y evitar tener en el css
Código CSS:
Ver original
  1. #rad1:checked ~ .tab1,
  2. #rad2:checked ~ .tab2,
  3. #rad3:checked ~ .tab3,
  4. #rad4:checked ~ .tab4,
  5. #rad5:checked ~ .tab5,
  6. #rad6:checked ~ .tab6,
  7. #rad7:checked ~ .tab7,
  8. #rad8:checked ~ .tab8,
  9. #rad9:checked ~ .tab9,
  10. #rad10:checked ~ .tab10...
así hasta infinitos tabs...

Gracias de nuevo por la ayuda.

Última edición por edgar4615; 13/09/2013 a las 10:29