Skip to content

Instantly share code, notes, and snippets.

@Antonio-Laguna
Created December 26, 2012 09:57
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 Antonio-Laguna/4379264 to your computer and use it in GitHub Desktop.
Save Antonio-Laguna/4379264 to your computer and use it in GitHub Desktop.
Sencilla animación CSS
/**
* Sencilla animación CSS
*/
body {
background: #EFEFEF;
}
div.recuadro {
background: #fff;
margin: 0 300px;
width: 100px;
padding: 25px;
text-align: center;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
-moz-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
}
@keyframes "agrandar" {
from {
-webkit-transform: scale(1.0);
-ms-transform: scale(1.0);
transform: scale(1.0);
}
to {
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
}
}
@-webkit-keyframes "agrandar" {
from {
-webkit-transform: scale(1.0);
transform: scale(1.0);
}
to {
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
}
/* Elemento al que asociamos la animación */
.recuadro:hover {
-webkit-animation-name: 'agrandar';
animation-name: 'agrandar';
animation-duration: 0.8s;
-webkit-animation-duration: 0.8s;
-webkit-animation-iteration-count: 2;
animation-iteration-count: 2;
-webkit-animation-timing-function: ease;
animation-timing-function: ease;
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
}
<div class="recuadro">Pasa el cursor por encima</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment