Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/10/2009, 06:50
Avatar de ldp
ldp
 
Fecha de Ingreso: marzo-2005
Ubicación: Por fin, en mi nueva casa!
Mensajes: 617
Antigüedad: 19 años, 1 mes
Puntos: 3
Pregunta Necesito ayuda con un sprite css.

Hola a todos ^^

Estoy intentando hacer un menú con la técnica de sprite, pero probablemente no he entendido muy bien cómo se hace (si alguien conoce un buen manual lo agradezco).

A ver, al imagen de fondo del menú sería algo así:


He marcado en rojo las partes en que se dividiría porque los menús no tienen tamaño fijo, entonces me interesa que se pueda expandir en vertical y horizontal sin perder la forma.

El código que estoy usando es:
En el html:
Código HTML:
<table class='menu1'>
<tr class='fila'>
<td class='si1'></td>
<td class='sc1'>".$caption."</td>
<td class='sd1'></td>
</tr>

<tr class='fila'>
<td class='ci1'></td>
<td class='cc1'>".$text."</td>
<td class='cd1'></td>
</tr>

<tr class='fila'>
<td class='ii1'></td>
<td class='ic1'></td>
<td class='id1'></td>
</tr>
</table> 
En el CSS:
Código PHP:
.menu1
{
    
clearnone;
    
overflowauto;
    
background:url(images/menu1/menu1.png);
}

.
fila
{
    
clearboth;
}

.
si1{width:16pxheight:49px;}
.
sc1{width:240pxheight:49pxbackground-position:-16px 0px;}
.
sd1{width:13pxheight:49pxbackground-position:-256px 0px;}
.
ci1{width:16pxheight:104pxbackground-position:0px -49px;}
.
cc1 {width:240pxheight:104pxbackground-position:-16px -49px;}
.
cd1{width:13pxheight:104pxbackground-position:-256px -49px;}
.
ii1 {width:16pxheight:16pxbackground-position:0px -153px;}
.
ic1{width:240pxheight:16pxbackground-position:-16px -153px;}
.
id1 {width:13pxheight:16pxbackground-position:-256px -153px;} 
El problema es que no hace puto caso del sprite, me pone la imagen entera de fondo y ya. Me estoy leyendo todo lo que encuentro de sprites, pero no me termino de enterar. Qué está mal?