1

I have been trying to change the color of the thumb of a range in css to white since an hour now but nothing seems to work.

#red::-webkit-slider-thumb {
  margin-top: -2.5px;
  cursor: pointer;
  background-color: white;
  background-image: white;
  background: white;
  color: white;}

Please help me out. I use brave browser.

1 Answers1

2

.slider-container {
  background: grey;
  padding: 2rem;
}

#red {
  -webkit-appearance: none;
  width: 100%;
  height: 1rem;
  background: #000;
  border-radius: .5rem;
}

#red::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 2rem;
  height: 2rem;
  background-color: #fff;
  cursor: pointer;
  border-radius: 50%;
}
<div class="slider-container">
  <p>Custom range slider:</p>
  <input type="range" min="1" max="100" value="50" id="red">
</div>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
DecPK
  • 24,537
  • 6
  • 26
  • 42