Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/09/2011, 23:11
Avatar de C2am
C2am
 
Fecha de Ingreso: enero-2009
Ubicación: Rosario, Argentina
Mensajes: 2.005
Antigüedad: 15 años, 3 meses
Puntos: 306
Respuesta: Imagen sobre imagen css

Aquí mi solución:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Documento sin título</title>
  5. <!--
  6. *{  margin:0;
  7.     padding:0;
  8.     }
  9. #cuadro{
  10.     width:152px;
  11.     height:127px;
  12.     position:relative;
  13.     overflow:hidden;
  14.     margin:auto;
  15.     }
  16. #marco{
  17.     position:relative;
  18.     width:152px;
  19.     height:127px;
  20.     background-image: url(images/imagen-superior.png);
  21.     background-repeat: no-repeat;
  22.     background-position: center center;
  23.     z-index:55;
  24.     }
  25. #foto{
  26.     z-index:1;
  27.     position:absolute;
  28.     width:152px;
  29.     height:127px;
  30.     left:0px;
  31.     top:0px;
  32.     }
  33. #foto img{
  34.     width:140px;
  35.     height:120px;
  36.     margin-left:6px;
  37.     margin-top:3px;
  38.     }  
  39. -->
  40. </head>
  41.  
  42.  
  43. <div id="cuadro">
  44.     <div id="marco"></div>
  45.     <div id="foto">
  46.         <img src="images/imagen-inferior.png"  />
  47.     </div> 
  48.  </div>
  49.  
  50.  
  51. </body>
  52. </html>

Con esta solución, el borde redondeado interno del marco amarillo queda sobre la imagen.
Se podría eliminar el div "foto" y aplicar los estilos directamente a la imagen, pero creo que para mayor claridad es mejor de esta forma.

Saudos
__________________
El mundo nada puede contra un hombre que canta en la miseria.
-- Ernesto Sábato--