Skip to content

Instantly share code, notes, and snippets.

@tx2z
Created March 15, 2013 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tx2z/5168920 to your computer and use it in GitHub Desktop.
Save tx2z/5168920 to your computer and use it in GitHub Desktop.
Cambiar entre dos imágenes al pasar el raton por encima con css - http://jesus.perezpaz.es/2013/01/cambiar-entre-dos-imagenes-al-pasar-el-raton-por-encima-con-css/
#imagen {
background: url(ruta a la imagen/imagen1.jpg) no-repeat;
height: (alto)px;
width: (ancho)px;
}
#imagen:hover {
background: url(ruta_a_la_imagen/imagen2.jpg) no-repeat;
height: (alto)px;
width: (ancho)px;
}
#imagen {
background: url(ruta_a_la_imagen/imagen1y2.jpg) no-repeat left;
height: (alto)px; //el alto original de la imagen1
width: (ancho)px; //el ancho original de la imagen1
}
#imagen:hover {
background-position: right
height: (alto)px; //el alto original de la imagen2
width: (ancho)px; //el ancho original de la imagen2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment