::-moz-meter-bar

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Phần tử giả CSS ::-moz-meter-bar đại diện cho thanh đồng hồ đo trong phần tử <meter>. Nó được dùng để chọn và áp dụng kiểu cho thanh đồng hồ bên trong phần tử meter.

Note: Theo mặc định, phần tử <meter> sử dụng kiểu dáng gốc của trình duyệt. Để áp dụng kiểu dáng của riêng bạn, trước tiên hãy đặt appearance: none trên phần tử <meter>, sau đó tạo kiểu bằng ::-moz-meter-bar.

Cú pháp

css
meter {
  appearance: none;
}
::-moz-meter-bar {
  /* ... */
}

Ví dụ

HTML

html
Normal: <meter min="0" max="10" value="6">Score 6/10</meter>
<br />
Styled: &nbsp;&nbsp;<meter class="styled" min="0" max="10" value="6">
  Score 6/10
</meter>

CSS

css
meter {
  height: 20px;
  width: 200px;
  vertical-align: -0.4rem;
}

.styled {
  appearance: none;
}

.styled::-moz-meter-bar {
  background: lime;
  box-shadow: 0 2px 3px grey inset;
  border-radius: 5px;
}

Kết quả

Đặc tả

Không thuộc bất kỳ tiêu chuẩn nào.

Tương thích trình duyệt

Xem thêm