twitter-bootstrap 更改警报信息文本颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25185164/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 21:16:56  来源:igfitidea点击:

Change alert info text color

htmlcsstwitter-bootstraptwitter-bootstrap-3

提问by 07_05_GuyT

Im using bootstrap 3 and I want to change the text color of the alert info and alert danger,I want that the texts become darker,how should I do that ?

我正在使用引导程序 3,我想更改警报信息和警报危险的文本颜色,我希望文本变暗,我该怎么做?

I search in bootstrap and I've found the following but didnt find the text color...

我在 bootstrap 中搜索,发现以下内容但没有找到文本颜色...

    .alert-info {
      background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
      background-image:         linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
      background-repeat: repeat-x;
      border-color: #9acfea;

} 

回答by James Donnelly

Looking at the Alerts sectionon Bootstrap's own website and through the unminfied CSS on their Github repositoryI can't find any of the CSS you've specified. Instead I can only find the following:

查看Bootstrap 自己网站上的Alerts 部分,并通过他们 Github 存储库上未压缩的 CSS,我找不到您指定的任何 CSS。相反,我只能找到以下内容:

.alert-info {
    color: #31708F;
    background-color: #D9EDF7;
    border-color: #BCE8F1;
}

If you want to make the colordarker, you can use a tool like http://paletton.comto generate some complimentary darker colours:

如果你想让color颜色变深,你可以使用像http://paletton.com这样的工具来生成一些免费的深色:

Example

例子

回答by Lux

You can just use the customizer!

您可以只使用定制器

If you want more flexibility, download the source code, modify the variables.lessand use LESSto compile it to CSS.

如果您想要更大的灵活性,请下载源代码,修改variables.less并用于LESS将其编译为 CSS。

Intresting for you is the @alert-info-bgvariable. Check out mixins/alerts.essand alerts.lessto see how the other colors are generated.

对你来说有趣的是@alert-info-bg变量。查看mixins/alerts.essalerts.less查看其他颜色是如何生成的。