How to make a input range

Hey guys i dont know how to change the color of the bar, i ask to gpt and he give a lot of css, there is onother way?(the blue is what i have and the other is what i want )
No description
No description
6 Replies
vince
vince3w ago
I don't know off the top of my head / not at my computer, but it's a range input. You probably need to select it and style it with a pseudo selector
Ppain254
Ppain2543w ago
Check under background-color of your nav css
Kevin Powell
Kevin Powell3w ago
Smashing Magazine
Creating A Custom Range Input That Looks Consistent Across All Brow...
Range inputs have notoriously been a pain to style. Each browser renders the input differently requiring you to use vendor prefixes in order to create a cohesive look and feel. In this article, we’ll take a look at the quirkiness of the HTML range input and demonstrate how to style the input to look consistent across all major browsers.
clevermissfox
clevermissfox2w ago
Has to be a custom input, pretty much have to strip it and build it back starting with appearance: none; and use the pseudo elements like ::-webkit-range-thumb / ::-moz-range-thumb and ::-webkit-slider-runnable-track / ::-moz- range track I think I’ve followed the article linked above before and if you google custom range input css you can find more supplementary resources. Gets really fun when you need to make a range with two thumbs to set a “range” of colour between them
capt_uhu
capt_uhu2w ago
wouldn't accent-color cover a lot of this these days?
Chris Bolson
Chris Bolson2w ago
As jsnkuhn says, accent-color will change the color however bear in mind that it will change both the track and the "thumb" which might not be what you want (though from looking at your images this should probably suffice). Alternatively, if you want these to have different colors you need to go down the pseudo element route. The only problem with this solution, at least as far as I know, is that this gives the whole track a uniform color and not just the "active" part so it isn't as clear as the default behaviour. One method to get around this issue of the whole track being the same color is to use box-shadows on the thumb to simulate the track, using a different box-shadow color on either side of the thumb.

Did you find this page helpful?