<label> label: <progress max="100" value="10">10%</progress></label>
<label> label: <progress max="100" value="40">40%</progress></label>
<label> label: <progress max="100" value="80">80%</progress></label>
<label> label: <progress max="100" value="100">100%</progress></label>
progress[value] {
--w: 10em; /* the width*/
--color: /* the progress color */
/* if < 30% "red" */
linear-gradient(red 0 0) 0 /calc(var(--w)*.3 - 100%) 1px,
/* if < 60% "orange" */
linear-gradient(orange 0 0) 0 /calc(var(--w)*.6 - 100%) 1px,
/* else "green" */
green;
--background: lightgrey; /* the background color */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: none;
width: var(--w);
margin: 0 10px;
background: var(--background);
-webkit-mask:
radial-gradient(circle closest-side,#000 98%,#0000 102%) 0/12.5% 100%,
linear-gradient(90deg,#000 50%, #0000 0) 8%/25% 100%
}
progress[value]::-webkit-progress-bar {
background: var(--background);
}
progress[value]::-webkit-progress-value {
background: var(--color);
}
progress[value]::-moz-progress-bar {
background: var(--color);
}
label {
font-size: 20px;
font-weight: bold;
display: block;
margin: 20px 0;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.