Skip to content

Instantly share code, notes, and snippets.

@SFantasy
Created August 1, 2013 09:33
Show Gist options
  • Save SFantasy/6129905 to your computer and use it in GitHub Desktop.
Save SFantasy/6129905 to your computer and use it in GitHub Desktop.
CSS animation example
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
.row > a#transform {
text-decoration: none;
width: 40px;
height: 40px;
display: inline-block;
text-align: center;
position:relative;
}
@keyframes 't' {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes 't' {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
.row > #transform:hover {
animation: t 1s infinite alternate;
-webkit-animation: t 1s infinite alternate;
}
</style>
</head>
<body>
<div class="row">
<a href="#" id="transform">BLOG</a>
</div>
<script src="lab.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment