How Can I change the background color of HTML meter?

Is there a way to change the background color of HTML meter?

I know ,by default its background color is green.

Is this possible to change its background color from green to any other color?

I tried with the style attribute but it still remains green.

 <meter style="background-color:red;"min="0" low="40" high="95" max="100" value="65">
 </meter>

meter::-webkit-meter-optimum-value {
    background: red; /* Green */
}
<meter min="0" low="40" high="95" max="100" value="65" col>
</meter>

meter::-webkit-meter-optimum-value {
  background: red;
}
meter::-moz-meter-bar { /* Firefox Pseudo Class */
  background: red;
}
<meter min="0" low="40" high="95" max="100" value="65">
</meter>

for chrome:

/*meter */
meter::-webkit-meter-bar {background: #e6e6e9;} /*background color of bar*/
meter::-webkit-meter-optimum-value {background: green;}
meter::-webkit-meter-suboptimum-value{background:orange;}
meter::-webkit-meter-even-less-good-value{background:red;}

for firefox:

/*meter */
/*bar with only one possible color*/
meter::-moz-meter-bar {background: red;}  /* color of bar*/

/* bar with different colors*/
/* between "low" and "high" thresholds*/
meter::-moz-meter-optimum-value {background: lightgreen;} 
/*below "low" threshold or above "high" threshold*/
meter::-moz-meter-suboptimum-value{background:gold;}  
链接地址: http://www.djcxy.com/p/87674.html

上一篇: 函数getElementById不起作用

下一篇: 如何更改HTML表格的背景颜色?