我在HTML文档中有这个:
<a class="wbutton tint" data-tint="rgba(255,0,0,.5)" href="#">This should be red, with an opacity of 0.5</a>
Run Code Online (Sandbox Code Playgroud)
这在CSS文件中:
.window > .content .wbutton.tint {
border: solid thin attr(data-tint, color);
box-shadow: inset 0 0 50px attr(data-tint, color);
}
Run Code Online (Sandbox Code Playgroud)
Firefox在Firebug中返回CSS错误.难道我做错了什么?
根据该对W3C规范attr()功能,它应该工作.
(另外,在MDN Wiki中有一个页面attr(),所以我认为它至少应该在Firefox中工作)