按钮出现了,看起来-6ren">
gpt4 book ai didi

css - 覆盖 :visited with Rails 3 and Foundation 4? 的正确方法是什么

转载 作者:技术小花猫 更新时间:2023-10-29 11:17:05 24 4
gpt4 key购买 nike

我正在使用 Foundation 4 开发一个新的 Rails 元素。我使用 Foundation 的类将一个链接变成了一个按钮:

<%= link_to 'New Item', new_item_path, :class => "small button round" %>

按钮出现了,看起来和我预期的一样:

enter image description here

但是,一旦我访问了该链接,它看起来像这样:

enter image description here

不太好。

我查看了 CSS,发现访问链接的颜色是在 scaffolds.css.scss 中设置的:

a {
color: #000;
&:visited {
color: #666;
}
&:hover {
color: #fff;
background-color: #000;
}
}

如何正确取消链接上的颜色更改?我知道我可以删除 &:visited 部分,但这似乎太蛮力了。我认为必须有一种更优雅的方式,但我的 CSS/SCSS/Foundation 知识太少了。

最佳答案

如果它只是由 rails g scaffold 命令生成,请删除您的 scaffold.css.scss。使用 zurb-foundation 时它可能是多余的,并且可以破坏更多其他东西。

关于css - 覆盖 :visited with Rails 3 and Foundation 4? 的正确方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15955292/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com