相关疑难解决方法(0)

使用jQuery选择和操作CSS伪元素,例如:: before和:: after

有没有办法使用jQuery 选择/操作CSS伪元素,如::before::after(以及带有一个分号的旧版本)?

例如,我的样式表具有以下规则:

.span::after{ content:'foo' }
Run Code Online (Sandbox Code Playgroud)

如何使用jQuery将'foo'更改为'bar'?

javascript css jquery jquery-selectors pseudo-element

897
推荐指数
14
解决办法
59万
查看次数

CSS3的attr()在主流浏览器中不起作用

我在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中工作)

css css3

40
推荐指数
2
解决办法
2万
查看次数