I have a meter styled like so.
meter
{
width: 5em;
height: 2em;
border-radius: 4px;
border: 2px gray solid;
color:red;
background: lightgray;
}
meter::meter-bar
{
background: green;
}
meter::-moz-meter-bar
{
background: green;
}
meter::-webkit-meter-bar
{
background: green;
}
<meter max="40" value="12"></meter>
In Firefox it looks like this:
But in Google Chrome (version 131.0.6778.86 64 bit Windows) it looks like this:
How can I get the Chrome version to look like the Firefox version?
2
Answers
To set the height of
meter
in Chome, you need to set height in::webkit-meter-bar
. I will provide updated code.You’ll need to set the
meter::-webkit-meter-optimum-value
to the color you wish.And apply a full height on
meter::-webkit-meter-bar
to grow the bar.