How to customize the HTML5 input range type looks using CSS?

后端 未结 10 2294
粉色の甜心
粉色の甜心 2020-11-27 15:24

I want to customize the looks of the range input type in HTML5 to look something like a progress bar. I\'ve tried applying some common CSS attributes using CSS class but it

10条回答
  •  时光说笑
    2020-11-27 15:58

    EDIT: nowadays all major browser support both

    • input[type='range']

    Hence you should use one of these two, as explained in other answers, and this should not be the accepted answer anymore.


    The is pretty new and you are already attempting to customize it with CSS. :)

    I wouldn't try that for two reasons:

    1. there might be huge compatibility issues now and for the next few (or many) years. Think that in nowadays a form control like has been created to show a slider NOT a progress bar, attempting to cheat on it with CSS in order to transform a slider into progress bar it sounds bizarre. Like trying to use CSS to change a