如何覆盖twitter Bootstrap上的按钮的链接颜色和边距/填充? [英] How to override link color and margins/padding on buttons in twitter Bootstrap?

查看:73
本文介绍了如何覆盖twitter Bootstrap上的按钮的链接颜色和边距/填充?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先发布在这里。我试图覆盖Bootstrap按钮的链接颜色,但是我无法使它工作。我实际上已经改变了背景颜色,但我无法获得链接颜色的改变。

 < span>我不知道如何将按钮分开。 
< button type =buttonclass =btn btn-default btn-lg>< a href =#>继续< / a>< / button>
< button type =buttonclass =btn btn-default btn-lg> < a href =#> Twitter< / a>< / button>
< button type =buttonclass =btn btn-default btn-lg>< a href =#> LinkedIn< / a>< / button>
< / span>

我的css目前看起来像:
.btn {
background-color:#d0d0d0;
text-align:center;
display:block;
}


解决方案

BootStrap按钮,您实际上必须定位 .btn 中的< a> 元素。例如:

  .btn a {
color:#000;
}

这会将按钮链接文字更改为黑色。希望这有帮助,让我知道如果您有任何问题!


First post here. I'm trying to override the link colors for Bootstrap buttons, but I can't get it to work. I actually got the background color to change, but I can't get the link colors to change. I also can't figure out how to space the buttons out more.

<span>
    <button type="button" class="btn btn-default btn-lg"><a href="#">Resume</a></button>
    <button type="button" class="btn btn-default btn-lg"> <a href="#">Twitter</a></button>
    <button type="button" class="btn btn-default btn-lg"><a href="#">LinkedIn</a></button>
</span>

My css currently looks like:
.btn{
    background-color:#d0d0d0;
    text-align:center;
    display:block;
}

解决方案

To change the text colour of the BootStrap buttons, you'll actually have to target the <a> element inside of the .btn. For example:

.btn a{
    color:#000;
}

This would change button link text to black. Hope this helped, let me know if you have any questions!

这篇关于如何覆盖twitter Bootstrap上的按钮的链接颜色和边距/填充?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆