如何将 sifr 规则应用于超链接及其 a.active 对应项
在 h1 内有一个超链接...就像这样:
blah
我对 css 应用了 sifr3 规则: h1#site-name
然后在 sifr3-rules.js 中我应用以下规则... "a": { "text-decoration": "无" }, “a:链接”:{“颜色”:“#FF0000”}, "a:hover": { "color": "#00FF00", "text-decoration": "none" }
但我在我的 Drupal 站点中意识到,它会自动将 .active 类添加到超链接,并且默认链接颜色获胜不起作用(但是悬停有效)...
我如何设置规则,以便应用类似 "a.active": { "color": "#FF0000" } 的内容? [顺便说一句,这没有任何作用,但我想也许这会有所帮助]
Have a hyperlink inside of a h1... like so:
<h1 id="site-name"><a href="blah">blah</a><h1>
I apply a sifr3 rule to the css: h1#site-name
then inside sifr3-rules.js i apply the following rules...
"a": { "text-decoration": "none" },
"a:link": { "color": "#FF0000" },
"a:hover": { "color": "#00FF00", "text-decoration": "none" }
But i realized in my Drupal site, it automatically adds .active class to the hyperlink, and the default link color won't work (however unusually the hover works)...
How can I set the rule so something like "a.active": { "color": "#FF0000" } gets applied?
[that does't do anything btw, but i thought maybe it would help it out]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信 Flash 允许您选择带有类名 (
a.active
) 的链接。最好的办法是将活动类放在h1
上。然后,您可以替换h1.active
来执行不同的样式。确保在其他h1
之前替换它。I don't believe Flash lets you select links with a class name (
a.active
). Best bet is to put the active class on theh1
instead. You can then replaceh1.active
to do the different styling. Make sure to replace it before the otherh1
s though.您可以执行以下操作之一:
1- 将 drupal 的 a.class 规则修改为:
这是为了拥有一致的网站(所有活动链接均为红色)
2- 或者您可以覆盖 CSS 规则:
you can do one of the following:
1- modify drupal's a.class rule to:
this is in order to have a consistent website (all active links are red)
2- or you can override the CSS rule: