Css规则只影响一些元素?

时间:2014-06-25 21:18:49

标签: css stylish

我正在尝试为blender.stackexchange创建自定义时尚主题,但规则只会影响我在FF 29.0.1中的某些标签

据我所知,所有标签元素都有相同的类/父元素/等,但只有一些受时尚样式表的影响。

我正在使用的完整时尚主题进行测试:

@-moz-document url('https://blender.stackexchange.com/') {

.post-tag, .tags a:hover, .tags * {
    color:red !important;
}

}

所有标签悬停时都会变为红色,但不在光标下时只有一些是红色。这是为什么?

以下是其中一个未被覆盖的标签示例:

enter image description here

其中一个(虽然根据检查员的说法,它不是!?):

enter image description here

有趣的是,我在SO上试过这个并且按预期工作。

2 个答案:

答案 0 :(得分:1)

现有的访问锚状态规则带有!important声明,阻止新颜色优先。

现有风格:

a.post-tag:visited {
    color: #566e76 !important;
}

答案 1 :(得分:0)

Thanks to Cryode,他指出:visited规则带有!important颜色声明。

我设法使用更多specific selector

来覆盖Stylish
a.post-tag, div.tags > a.post-tag:visited {
    color:blue !important;
}