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

Can't change inactive color of bootstrap button text

我是 bootstrap、css 和 html 的新手,但到目前为止它看起来相当友好。我有一些按钮问题,我不确定该怎么想。主要是,我希望按钮中的文本为黑色,然后只在悬停时加下划线。我先尝试做一些内联 css,但没有用,所以我想 "let's try to find it in the bootstrap.css source and see change the color",这正是我所做的,它对悬停文本有效,但在其他方面无效,这里是我所做的更改:

.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 相关标签。巧合的是,我只是想美化我丑陋的 shell 网站,该网站由 'django' 提供支持!在此先感谢您的任何建议。

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

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

还有 bootstrap 未被看到的更改的问题可能是缓存,我在 this link

找到了一个不错的技巧

祝你好运

这些 类 控制您尝试使用的 "btn-warning" 的行为。

.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>