::-moz-range-progress

非標準:此特性未標準化。我們不建議在生產環境中使用非標準特性,因為它們瀏覽器支援有限,並且可能會更改或被移除。但是,在沒有標準選項的特定情況下,它們可以是合適的替代方案。

::-moz-range-progress CSS 偽元素 是一個 Mozilla 擴充套件,它表示 <input> 型別為 type="range"軌道(即滑槽)的下半部分,滑塊在該滑槽中滑動。這部分對應於低於 滑塊(即虛擬旋鈕)當前選定值的值。

注意:::-moz-range-progress 用於除了 <input type="range"> 以外的任何元素都不會匹配任何內容,也不會產生任何效果。

語法

css
::-moz-range-progress {
  /* ... */
}

示例

HTML

html
<input type="range" min="0" max="100" step="5" value="50" />

CSS

css
input[type="range"]::-moz-range-progress {
  background-color: green;
  height: 1em;
}

結果

使用此樣式的進度條可能如下所示:

The progress bar is a thick green square to the left of the thumb and a thin grey line to the right. The thumb is a circle with a diameter the height of the green area.

規範

不屬於任何標準。

瀏覽器相容性

另見