CSS 如何在 bootstrap 2.3.2 中更改字体颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24385776/
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
How to change font color in bootstrap 2.3.2
提问by user1887686
Would someone please tell me how to change the font color on bootstrap 2.3.2? I want all of the typography to be color: #000000;, except for links of course. Everything I've tried adding to my custom css file hasn't worked.
有人能告诉我如何更改 bootstrap 2.3.2 上的字体颜色吗?我希望所有的排版都是彩色的:#000000;,当然链接除外。我尝试添加到自定义 css 文件中的所有内容均无效。
回答by achedeuzot
Have you checked the order in which your css files are loaded ? Usually the problem comes from the fact that your bootstrap files are loaded afteryour custom CSS, thus overriding your custom settings.
您是否检查过 css 文件的加载顺序?通常问题来自这样一个事实,即您的引导文件是在您的自定义 CSS之后加载的,从而覆盖您的自定义设置。
Another problem could be your browser cache. Be sure to refresh the css files also (Ctrl+ F5or Cmd+ R).
另一个问题可能是您的浏览器缓存。请务必也刷新 css 文件(Ctrl+F5或Cmd+ R)。
回答by opatut
Overwrite with custom CSS
使用自定义 CSS 覆盖
Create a file, e.g. custom.css
with this content:
创建一个文件,例如custom.css
使用以下内容:
body {
color: #000;
}
Then, make sure to include it afterbootstrap:
然后,确保在引导后包含它:
<link rel="stylesheet" href="bootstrap.css" type="text/css" />
<link rel="stylesheet" href="custom.css" type="text/css" />
Generate custom bootstrap.css
生成自定义 bootstrap.css
You could also compile a custom bootstrap css hereand set @text-color
to #000
.
您还可以在此处编译自定义引导 css并设置@text-color
为#000
.
回答by user3363737
You can change in bootstrap.css
您可以在 bootstrap.css 中更改
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #000000; // Changed
}
Hope this will help you.
希望这会帮助你。