Skip to content

Instantly share code, notes, and snippets.

@azedo
Created May 17, 2013 18:21
Show Gist options
  • Save azedo/5600944 to your computer and use it in GitHub Desktop.
Save azedo/5600944 to your computer and use it in GitHub Desktop.
HTML5 / CSS3 Circle with Partial Border
/**
* HTML5 / CSS3 Circle with Partial Border
* http://stackoverflow.com/q/13059190/1397351
*/
* { margin: 0; padding: 0; }
.circle {
position: relative;
margin: 7em auto;
width: 16em; height: 16em;
border-radius: 50%;
background: lightblue;
}
.arc {
overflow: hidden;
position: absolute;
top: -1em; right: 50%; bottom: 50%; left: -1em;
transform-origin: 100% 100%;
transform: rotate(45deg) skewX(30deg);
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-timing-function: linear;
animation-play-state: paused;
}
@keyframes slidein {
from {
transform: rotate(45deg) skewX(30deg);
}
to {
transform: rotate(405deg) skewX(30deg);
}
}
.arc:before {
box-sizing: border-box;
display: block;
border: solid 1em navy;
width: 200%; height: 200%;
border-radius: 50%;
transform: skewX(-30deg);
content: '';
}
<!-- content to be placed inside <body>…</body> -->
<div class='circle'>
<div class='arc'></div>
</div>
{"view":"split-vertical","fontsize":"90","seethrough":"1","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment