如何更改HTML中进度条值的颜色?

前端之家收集整理的这篇文章主要介绍了如何更改HTML中进度条值的颜色?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

progress {
  border: none;
  width: 400px;
  height: 60px;
  background: crimson;
}

progress {
  color: lightblue;
}

progress::-webkit-progress-value {
  background: lightblue;
}

progress::-moz-progress-bar {
  background: lightcolor;
}

我几乎尝试了所有东西,但进度条的值颜色保持不变.唯一能够响应变化的浏览器是IE. Firefox允许仅更改背景颜色. Chrome根本不显示任何内容.你能发现我的代码有什么问题吗?

最佳答案
progress {
  border: none;
  width: 400px;
  height: 60px;
  background: crimson;
}

progress {
  color: lightblue;
}

progress::-webkit-progress-value {
  background: lightblue;
}

progress::-moz-progress-bar {
  background: lightcolor;
}

progress::-webkit-progress-value {
  background: red;
}

progress::-webkit-progress-bar {
  background: blue;
}
It will work on webkit browser,like this example

原文链接:https://www.f2er.com/html/426621.html

猜你在找的HTML相关文章