Style lower and upper fill in HTML5 range input

前端 未结 5 612
北海茫月
北海茫月 2020-12-05 07:33

As explained here, IE allows styling of the lower and upper fill or track regions in CSS as follows:

5条回答
  •  忘掉有多难
    2020-12-05 08:10

    There's a (newish?) pseudo-element for Firefox that styles (what IE calls) the 'lower' part of the range input. According to the documentation:

    The ::-moz-range-progress CSS pseudo-element represents the portion of the "track" (the groove in which the indicator aka thumb slides) of an of type="range", which corresponds to values lower than the value currently selected by the thumb.

    For the upper track, you still use (per Alexander Dayan's answer) ::-moz-range-track.

    I just discovered and tried it today; works pretty well.

提交回复
热议问题