【问题标题】:jQuery button a href textjQuery按钮一个href文本
【发布时间】:2011-08-11 07:07:41
【问题描述】:

我有一个 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>

结果我有:

所以问题是href 中的Back 文本不是白色的,为了解决这个问题,我添加了下面的样式。

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

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

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

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

【问题讨论】:

    标签: html css


    【解决方案1】:

    您没有将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;}
    

    【讨论】:

      【解决方案2】:

      是否访问了“返回”链接?如果您为链接的“已访问”版本设置 css 是否可以修复它?

      【讨论】:

        【解决方案3】:

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

        a.button {color: #fff}
        a.button:hover {color: #026890;}
        

        【讨论】:

          猜你喜欢
          • 2013-12-14
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-03-16
          • 1970-01-01
          • 2012-05-24
          • 2014-01-19
          • 1970-01-01
          相关资源
          最近更新 更多