How to change slider range background color using css?
问题 I currently have a slider that I am styling with CSS. What I want is the range to change color when the thumb is slid. Similar to this picture: How can I do this using only CSS? Below is what I have tried so far. .range-slider .range-bar { -fx-background-color: red; } 回答1: You can do this by using a linear-gradient for the track background, and binding the point where the gradient changes to the slider's value. The basic idea would be that when, e.g., the slider's value is at 50%, the