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

205
Visualizações
How to set color for part of the border?

How to set the color for part of the border only?

This is an example of my code where I could only change 25% of the border only by using 4 parameters of the border, but is there any way that I could do something like 37%, 65% or others?

#circle-wrapper {
  position: relative;
}

.circle {
  position: absolute;
  background: transparent;
  top: 20vh;
  left: 35vw;
  width: 30vw;
  height: 30vw;
  border-radius: 100%;
  border: 2.5vw solid;
  border-color: #82ba00;
}

#area {
  border-color: #82ba00 #82ba00 transparent blue;
}
<div id='circle-wrapper'>
<div class='circle' id='area'></div>
</div>

This is the closest I could get but I want the different border-color (blue) start from the left border.

setInterval(()=>{
     document.querySelector('#hidden_area').style.transform = `rotate(${Math.random()*180}deg)`

},1000)
#circle-wrapper {
  position: relative;
}

.circle {
  position: absolute;
  background: transparent;
  top: 20vh;
  left: 35vw;
  width: 30vw;
  height: 30vw;
  border-radius: 100%;
  border: 2.5vw solid;
  border-color: #82ba00;
}

#area {
  border-color: #82ba00 #82ba00 transparent #82ba00;
}

#hidden_area {
  border-color: transparent blue transparent transparent;
  transform: rotate(45deg);
}
<div id='circle-wrapper'>
<div class='circle' id='area'></div>
<div class='circle' id='hidden_area'></div>
</div>

The following border-color effect is the thing I want to achieve.

Is there any way I could achieve this with CSS or JS?

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
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