Skip to content

Instantly share code, notes, and snippets.

@maxxcrawford
Created February 12, 2014 20:44
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 maxxcrawford/8964119 to your computer and use it in GitHub Desktop.
Save maxxcrawford/8964119 to your computer and use it in GitHub Desktop.
CSS Transform/Animation Scale Example ( http://jsfiddle.net/aNX9h )
<!doctype html>
<html>
<head>
<title>CSS animations: Example 1</title>
<style type="text/css">
body {
padding: 20px;
}
.contain {
width: 50px ;
height: 50px;
}
.circle {
background: red;
animation: rotate 1s linear 0s infinite alternate;
-moz-animation: rotate 1s linear 0s infinite alternate;
-ms-animation: rotate 1s linear 0s infinite alternate;
-webkit-animation: rotate 1s linear 0 infinite alternate;
width: 100%;
height: 100%;
line-height: 100%;
border-radius: 50%;
}
@keyframes rotate {
from { transform: scale( 1 ); }
to { transform: scale( 1.2 ); }
}
@-moz-keyframes rotate {
from { -moz-transform: scale( 1 ); }
to { -moz-transform: scale( 1.2 ); }
}
@-ms-keyframes rotate {
from { -ms-transform: scale( 1 ); }
to { -ms-transform: scale( 1.2 ); }
}
@-webkit-keyframes rotate {
from { -webkit-transform: scale( 1 ); }
to { -webkit-transform: scale( 1.2 ); }
}
</style>
</head>
<body>
<div class="contain"><div class="circle"></div></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment