I'm attempting to design a unique range slider using CSS.
<style>
.slide-container {
width: 300px;
}
.slider {
-webkit-appearance: none;
width: 100%;
height: 5px;
border-radius: 5px;
background: #FFFFFF;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 23px;
height: 24px;
border: 0;
border-radius: 50%;
background: #DAA521;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 23px;
height: 24px;
border: 0;
border-radius: 50%;
background: #DAA521;
cursor: pointer;
}
</style>
Here's the HTML:
<div class="slide-container">
<input type="range" min="1" max="100" value="50" class="slider" id="myRange">
</div>
I would like to change background: #DAA521;
to
background: url('{% static 'images/coffee.png' %}');
so the thumb displays as an image rather than just a colored circle. However, this doesn't seem to be effective in practice. Any suggestions?