GitHub 6956★

Have you seen CSS Scan?

The fastest and easiest way to check, copy and edit CSS.

Learn more →

CSS Scan logo

Progress bar

HTML

<div class="container">
<!-- Width based on the number of percentages -->
<div class="container__progress" style="width: 40%;">
<!-- The number of percentages -->
40%
</div>
</div>

CSS

.progress-bar {
/* Colors */
background-color: #d1d5db;

/* Rounded border */
border-radius: 9999px;
padding: 0.25rem;
}

.progress-bar__progress {
/* Center the content */
align-items: center;
display: flex;
justify-content: center;

/* Colors */
background-color: #3b82f6;
color: #fff;

/* Rounded border */
border-radius: 9999px;
}
Demo
40%

See also

Follow me on and to get more useful contents.