如何将默认Bootstrap链接悬停颜色更改为自定义颜色?

时间:2016-12-04 05:55:52

标签: jquery html css twitter-bootstrap

如何将默认的Bootstrap链接悬停颜色更改为自定义颜色?

似乎chrome检查器(DOM)不接受我的CSS代码(即使使用!important)。如何在将网站上传到网络时使用我的代码?

这是我的CSS:

a {
    color: hsla(34,55%,54%,1);
}

footer > a: hover {
    color: hsla(151,27%,56%,1) !important;
}

这是我的HTML:

<footer class="col-sm-12">
            <address>
                <a href="privacy-policy.html">Privacy Policy</a>  | © 2014 Colostomo | <a href="about.html">About This Site</a> <br> Colostomo • 1000 Main Street • Marshall, MO 65340 • 660-555-1212
            </address>
        </footer>

1 个答案:

答案 0 :(得分:0)

使用页脚&gt;地址&gt; a:悬停而不是页脚&gt; a:悬停,因为页脚没有孩子a。

&#13;
&#13;
a {
    color: hsla(34,55%,54%,1);
  
}

footer > address >a:hover {
    color: hsla(151,27%,56%,1) !important;

}
&#13;
<footer class="col-sm-12">
            <address>
                <a href="privacy-policy.html">Privacy Policy</a>  | © 2014 Colostomo | <a href="about.html">About This Site</a> <br> Colostomo • 1000 Main Street • Marshall, MO 65340 • 660-555-1212
            </address>
        </footer>
&#13;
&#13;
&#13;

相关问题