How do I round the corners of a HTML progress bar?

Viewed 109

I know you round corners with border-radius, but it works like this with a progress bar:

<html>
<progress value="50" max="100" min="0" class="progress1">
    </progress>
<style>
.progress1 {
width:500px;
height:100px;
background-color: red;
        border-radius: 10px;
}
progress::-webkit-progress-value {
    background: red; 
        border-radius: 10px;
}
    </style>
</html>

I've tested with a few browsers, and so far it only does what I want it to do on Internet Explorer. I want the actual background of the progress in the progress bar to get rounded, not the actual progress.

1 Answers

The following seems to work for your case:

<html>
<progress value="50" max="100" min="0" class="progress1"></progress>
<style>
  .progress1 {
    width: 500px;
    height: 100px;
    background-color: red;
    border-radius: 10px;
  }
  
  progress::-webkit-progress-bar {
    width: 500px;
    height: 100px;
    border-radius: 10px;
  }
  
  progress::-webkit-progress-value {
    background-color: red;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
  }
  
  progress::-moz-progress-bar {
    width: 500px;
    height: 100px;
    background-color: red;
    border-radius: 10px;
  }
</style>

</html>

The Fiddle

Modified from to this post

Related