无法更改引导按钮文本的非活动颜色

时间:2017-05-18 06:05:25

标签: html css html5 twitter-bootstrap django-bootstrap3

我是bootstrap,css和html的新手,但到目前为止它似乎非常友好。我有一些按钮麻烦,我不知道该怎么想。主要是,我希望按钮中的文本为黑色,然后在悬停时仅下划线。我先尝试做一些inl ine css,没有工作,所以我想"让我们试着在bootstrap.css源代码中找到它并看到改变颜色",这是正是我做了什么,它对悬停文本起作用,但不是这样,这里是我所做的更改:

.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269} 

更改为:

.text-info{color:#000}a.text-info:focus,a.text-info:hover{color:#000}

并且bootstrap.css中没有出现任何其他text-info。如果它有帮助,这里是按钮位于第一列的容器行:

<div class="row">
    <div class="col-sm-6 col-md-6 col-lg-6" >
        <div class="well"><a href="" class="btn-warning btn-block text-center text-info">Button</a></div>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6">
                div class="well">This is the first row and second column</div>
</div>

你可以通过我的行中的文字告诉我新的。我认为唯一可能相关的事情就是我排队了井的颜色。任何建议表示赞赏。我标记了django,因为它是与统计数据无关的唯一其他(与twitter)bootstrap相关的标记。巧合的是,我只是试图美化我丑陋的屁股贝壳网站,该网站由“django&#39;!”提供支持。提前感谢任何建议。

2 个答案:

答案 0 :(得分:1)

您可以添加自定义css文件并在加载bootstrap.css后加载它。这将覆盖设置,我从不搞乱bootstrap.css,因为我从其他地方而不是本地加载它。

编辑:您也可以内联更改(html明智),但这不是一个好的做法,我们喜欢分离关注点。

此外,引导程序更改的问题不在于缓存,我在this link找到了一个很好的技巧

祝你好运

答案 1 :(得分:1)

这些是控制&#34; btn-warning&#34;行为的类。你试图使用。

.btn-warning {
  color: #ffffff; /*Make the color Change Here*/
  background-color: #f0ad4e;
  border-color: #eea236;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
  color: #ffffff;
  background-color: #ed9c28;
  border-color: #d58512;
text-decoration:underline;
}

.btn-warning:active,
.btn-warning.active,
.open .dropdown-toggle.btn-warning {
  background-image: none;
}

.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
  background-color: #f0ad4e;
  border-color: #eea236;
}

对html进行这些更改

<div class="row">
    <div class="col-sm-6 col-md-6 col-lg-6" >
        <div class="well"><a href="" class="btn btn-warning">Button</a></div>
    </div>
    <div class="col-sm-6 col-md-6 col-lg-6">
                div class="well">This is the first row and second column</div>
</div>