Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Animate to natural width
/* Animate to natural width */
body { background: black; padding: 100px; margin: 0; }
.progress-bar {
border: 2px solid red;
border-radius: 14px;
overflow: hidden;
.progress-bar > div {
color: white;
background: red;
white-space: nowrap;
padding: 10px 20px;
box-sizing: border-box;
animation: progress-bar 2s;
@keyframes progress-bar {
0% { width: 0; }
<div class="progress-bar">
<div style="width: 100%">Upload is 100% complete</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.