Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!