Skip to content

Instantly share code, notes, and snippets.

@hyjk2000
Last active October 8, 2015 08:22
Show Gist options
  • Select an option

  • Save hyjk2000/10243670 to your computer and use it in GitHub Desktop.

Select an option

Save hyjk2000/10243670 to your computer and use it in GitHub Desktop.
Styling HTML5 progress Element
/**
* Styling HTML5 progress Element
*/
progress[value] {
appearance: none;
position: relative;
width: 500px;
height: 30px;
}
progress[value]::after {
content: attr(value) "%";
color: #465298;
line-height: 30px;
position: absolute;
top: 0;
right: -4.5em;
width: 4em;
}
progress[value]::-webkit-progress-bar {
background: none;
border: 3px solid #465298;
border-radius: 1.5em;
overflow: hidden;
}
progress[value]::-webkit-progress-value {
background: linear-gradient(-45deg, #606dbc 32%, #465298 33%, #465298 66%, #606dbc 67%);
background-size: 50px 100%;
animation: flow 2s linear infinite;
}
@keyframes flow {
to { background-position: -50px 0 }
}
<progress max="100" value="0"></progress>
var progress = document.querySelector("progress[value]");
setInterval(function () {
if (++progress.value > 100) progress.value = 0;
}, 100);
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment