Skip to content

Instantly share code, notes, and snippets.

@machal
Created February 5, 2012 12:09
Show Gist options
  • Select an option

  • Save machal/1745060 to your computer and use it in GitHub Desktop.

Select an option

Save machal/1745060 to your computer and use it in GitHub Desktop.
Dabblet: Loading spinner with animated SVG
/**
* Dabblet: Loading spinner with animated SVG
*/
body {
background: lightgrey;
}
/* Modern browsers */
.loading {
width: 50px;
height: 50px;
background: url('http://www.vzhurudolu.cz/css3/src/spinner_animated.svg') center center no-repeat;
}
.loading .alternate {
display: none;
}
/* Fallback for browsers without SVG support (IE8- for example, detected by Modernizr) */
.no-svg .loading {
background-image: none;
}
.no-svg .loading .alternate {
display: inline;
}
<p class="loading">
<span class="alternate">
Loading…
</span>
</p>
<!-- Using Modernizr for CSS animations detect (see CSS) -->
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
{"view":"split","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment