Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
Transparent dynamic circular progress bar in JavaScript/CSS like hollow from inside or background image visible?

I achieved the circular progress bar with background color like this:

enter image description here

But when i try to use this same code but without background color it becomes PI or rectangular. I want to achieve like this:

enter image description here

But what i have is:

enter image description here

If i try to remove bg color it becomes

enter image description here

I searched a lot but couldn't found any solution.

Here is the code that i am using for this.

<!-- Progress bar -->
<div class="bar-container">
   <div class="circular-progress" style="background: conic-gradient(#FFCAF0 <?php echo $percentage * 3.6; ?>deg, #003866 5deg);">
      <div class="value-container"><?php echo $percentage; ?>%</div>
     </div>
</div>

Here is CSS code:

.bar-container {
        background-color: #003866;
        display: grid;
        place-items: center;
    }
    .circular-progress {
        position: relative;
        height: 200px;
        width: 200px;
        border-radius: 50%;
        display: grid;
        place-items: center;
    }
    .circular-progress::before {
        content: "";
        display: block !important;
        position: absolute;
        height: 84%;
        width: 84%;
        background-color: #003866;
        border-radius: 50%;
    }
    .value-container {
        position: relative;
        font-size: 20px;
        color: #FFCAF0;
    }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can add clip-path to “cut out” the inner circle.

.bar-container {
  background-image: url('https://invent.kde.org/plasma/breeze/-/raw/6d4fe7781790c69758be380324262261699894f7/wallpapers/Next/contents/images/1024x768.png');
  background-size: fill;
  background-position: center;
  background-repeat: no-repeat;
  display: grid;
  place-items: center;
  padding: 20px;
}
.circular-progress {
  position: relative;
  height: 200px;
  width: 200px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background-image: conic-gradient(#FFCAF0 120deg, transparent 5deg);
  clip-path: path('M20 100 a80 80 0 1 0 160 0 a80 80 0 1 0 -160 0 L0 100 L0 0 L200 0 L200 200 L0 200 L0 100 Z');
}
.value-container {
  position: absolute;
  top: 100px;
  width: 100%;
  text-align: center;
  font-size: 20px;
  color: #FFCAF0;
}
<div class="value-container">33&nbsp;%</div>
<div class="bar-container">
   <div class="circular-progress"></div>
</div>

You can move the background-image property out of the CSS to edit it via PHP (but I guess you would have to use JavaScript to change it gradually).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda