jQuery按钮一个href文本

时间:2011-08-11 07:07:41

标签: html css

我有一个href链接作为jquery按钮

$("a.button, button, input:submit", "div").button();

<a href="/Home/Acton" class="button">Back</a>
<button name="submit" id="continue" value="continue">Continue</button>

因此我得到了:

enter image description here

所以问题是href中的Back文本不是白色,为了修复我已添加下面的样式。

/*jQuery buttons a href style fix*/
a.button:link {color: #fff !important;} 
a.button:hover {color: #026890;}

我可以在firebug中看到应用了样式但是没有帮助,Back文本仍然不是白色。

问题是当Back处于悬停状态时看起来不错,但是当不悬停时,文字应该是白色的,就像Continue一样,但事实并非如此。

我如何在CSS中解决这个问题?

3 个答案:

答案 0 :(得分:2)

您没有将a:visited设为白色,这就是您遇到这种情况的原因,您也可以将a:hover设为#026890

所以试试看:

/*jQuery buttons a href style fix*/
a.button:link {color: #fff !important;} 
a.button:visited {color: #fff !important;} 
a.button:active {color: #026890 !important;} 
a.button:hover {color: #026890 !important;}

答案 1 :(得分:0)

是否访问了“后退”链接?如果您为链接的“已访问”版本设置了css,那该怎么办呢?

答案 2 :(得分:0)

您可以使用以下代码解决此问题:

a.button {color: #fff}
a.button:hover {color: #026890;}
相关问题