Skip to content

Instantly share code, notes, and snippets.

@dubilla
Created September 5, 2012 23:46
Show Gist options
  • Save dubilla/3647924 to your computer and use it in GitHub Desktop.
Save dubilla/3647924 to your computer and use it in GitHub Desktop.
Just a very simple css3 spinner made with only 2 divs, it will work on every browsers except IE because it doesn't support css animations.
<div class="spinner">
<span class="mask"></span>
</div>
// just a very simple css3 spinner made with only 2 divs
// will work on every browsers except IE because it doesn't support css animations
body {
margin:50px; background:white;
}
.spinner {
width: 15px;
height:15px;
border:6px solid purple;
border-radius:100%;
-webkit-animation: spin 1.5s infinite linear;
-moz-animation: spin 1s infinite linear;
-ms-animation: spin 1s infinite linear;
animation: spin 1s infinite linear;
}
.spinner .mask {
overflow:hidden; position:absolute;
top:-6px;
bottom:-6px;
right:6px;
left:-6px;
}
.spinner .mask:after {
content:''; position:absolute; top:0; left:0;
border-radius:100%;
width:15px; height:15px;
border:6px solid orange;
overflow:hidden;
}
@-webkit-keyframes spin {
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframesspin spin {
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
to { -ms-transform: rotate(360deg); }
}
@keyframes spin {
to { transform: rotate(360deg); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment