样式<米>最新 Opera 版本中的标签米>
我目前正在尝试在所有主要浏览器中设置
标签的样式:IE7-9、FF、Chrome、Safari 甚至 Opera。我已经成功地使用以下 CSS 代码删除了默认的
样式:
meter::-webkit-meter-bar, meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value {
background: 0;
}
该技术在所有提到的浏览器中都可以正常工作,除了 Opera!它一直显示默认的绿色仪表。关于如何在 Opera 中“取消样式”
标签有什么想法吗?
I'm currently trying to style a <meter>
tag in all major browsers: IE7-9, FF, Chrome, Safari and even Opera. I've managed to remove the default <meter>
styling by using the following CSS code:
meter::-webkit-meter-bar, meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value {
background: 0;
}
This technique works fine in all mentioned browsers, except Opera! It keeps showing the default green meter. Any idea on how to "destyle" the <meter>
tag in Opera?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前还没有办法在 Opera 中设置此类元素的样式。有一个名为 组件对象模型 的提案,它将间接允许我们在以下情况下进行此类样式设置:在工作草案中,但我们还没有接近这一目标。
Webkit 实现了一种不属于任何标准的方法,只是一个建议,我不认为将来会是这样。这些伪元素名称很可能会改变。
There is no way yet to style such elements in Opera. There is a proposal called Component Object Model which will obliquely allow us to do such styling when it is in a Working Draft, but we are not close to one.
Webkit has implemented a method that is not in any standard and just a suggestion, and I wouldn't assume this is how it would in the future. Most likely these pseudo-element names would change.
在开始之前:不应该是
background:transparent;
或background:inherit;
吗?请参阅 HTML Dog 中的背景属性。我认为你误会了。
meter::-webkit-meter-bar
选择器对 IE、FF 和 Opera 应该没有任何影响,因为-webkit
部分是 Webkit 的选择器。 Chrome 和 Safari 使用 Webkit 作为渲染引擎,但 FF 使用 Gecko,Opera 使用 Presto 等。对于 FF,您可能需要类似
-moz-meter-bar
...对于歌剧我不知道。 这个 Opera 社区页面 似乎暗示前缀是
-o
而不是-webkit
或-moz
。祝你好运。
添加此类规则时包含“正常”选择器也是一个好习惯。
(如果你幸运的话,这可能会让它在 Opera 中工作。)
Before I start: shouldn't it be
background: transparent;
orbackground: inherit;
? See the background property in HTML Dog.I think you're misunderstanding. The
meter::-webkit-meter-bar
selector should have no effect at all on IE, FF and Opera since the-webkit
part is a selector for Webkit. Chrome and Safari use Webkit as a render engine, but FF uses Gecko, Opera uses Presto, etc.For FF you would probably need something like
-moz-meter-bar
...For Opera I do not know. This Opera community page seems to imply that the prefix would be
-o
rather than-webkit
or-moz
.Good luck.
It's also a good practice to include the "normal" selector when adding such rules.
(And if you're lucky, this might just make it work in Opera.)