DEV Community

Muhammad Rauf
Muhammad Rauf

Posted on

Create A Circular Progress Bar using HTML CSS

Circular progress bars are a staple of web development. It’s one of those little minor details that can immensely impact a user’s experience and flow. While it’s easy to cheat and just get one of those looped animated loading icon gifs, or spin an element on the page — a really cool effect to have is a proper loading bar with a percentage progression. In my last post we see How we can create Color picker In HTML CSS. SO, In this post you will learn How to create Circular Progress bar Using HTML, CSS and a bit JS.
Image description

But how exactly do you do that?

Turns out you only need a dash of HTML, a little bit of CSS, and a pinch of a JavaScript function.

Animated circular Progress Bar is a type of statistical design used in a variety of websites. It is mainly used to indicate the percentage of one's qualification in a portfolio website or personal website. It is fully animated, that is, under normal conditions, it has zero percent then it will gradually reach the pre-determined percentage. Different colors have been used to denote percentages.

HTMl Code:

<div class="soft-circle">
  <div class="inside"></div>
  <div class="key">95%</div>
  <div class="circle">
     <div class="shade left">
        <div class="progressing"></div>
     <div class="shade right">
        <div class="progressing"></div>
Enter fullscreen mode Exit fullscreen mode

CSS Code:

  width: 100px;
  position: relative;  
  border:solid #000 1px;
.soft-circle .inside{
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  height: 80px;
  width: 80px;
  margin: -40px 0 0 -40px;
  background: #390a1f;
  border-radius: 100%;}
.soft-circle .key{
  position: absolute;
  transform: translate(-50%, -50%);
.soft-circle .shade{
  position: absolute;
  height: 100%;
  width: 100%;
  background: #eee;
  -webkit-border-radius: 100%;
  clip: rect(0px, 100px, 100px, 50px);}
.circle .shade .progressing{
  position: absolute;
  height: 100%;
  width: 100%;
  -webkit-border-radius: 100%;
  clip: rect(0px, 50px, 100px, 0px);
  background: #4158d2;}
.circle .left .progressing{
  animation: left 4s linear both;
@keyframes left{
  100%{transform: rotate(180deg);}
.circle .right {transform: rotate(180deg);
.circle .right .progressing{
  animation: right 4s linear both;
@keyframes right{
  100%{transform: rotate(160deg);}
Enter fullscreen mode Exit fullscreen mode

JavaScript Code:

const numb = document.querySelector(".key");
let counter = 0;
setInterval(() => {
  if(counter == 95 ){
    numb.textContent = counter + "%";
}, 80);
Enter fullscreen mode Exit fullscreen mode

Hopefully from this article, you have learned how to make it. If there is any difficulty, you can let me know by discussing below.
Read in detail from our official website Create A Circular Progress Bar using HTML CSS

To see DEMO

Don’t forget to like and Follow😉

Discussion (0)