Discover a stunning CSS animation combined with a unique shape.
The only drawback is the visible center cut out of the circle, which cannot be transparent and must match the background color. (You can set the inner circle's background to an image or any other suitable option, but transparency is not possible.)
Take a look at the CSS code below:
.circ {
width: 100px;
height: 100px;
border-radius: 50%;
background-image: url("http://www.freefever.com/stock/commercial-wallpapers-abstract-colored-texture-backgroundand-photo-high.jpg");
position: relative;
top: 100px;
margin: 0 auto;
overflow: hidden;
-webkit-animation: Spin 1s linear infinite;
}
.circ:before {
content: "";
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
background: #fff;
position: absolute;
left: 50%;
top: 50%;
margin-left: -20px;
margin-top: -20px;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}
@-webkit-keyframes Spin {
from {
background-position: 0 0;
}
to {
background-position: 0 100%;
}
}
For a live demonstration, check out this fiddle: Demo
Updated fiddle (addition of other browser prefixes): Demo
I recommend creating a separate CSS file for animations to keep your main CSS file organized, especially when dealing with keyframes that take up space. Consider using something like animations.css for your animations, separating them from the regular styles in your main CSS file.
If you require the center to adapt responsively to its background, consider checking out the solution provided by theChrisMarsh.