外部CSS:身体背景颜色不会改变

时间:2016-11-23 08:40:36

标签: css3 twitter-bootstrap-3 background-color

我无法在Bootstrap 3网站上更改我的身体背景颜色。这是我的外部CSS文件的片段:

body {
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}

我尝试了下面的事情,没有任何快乐:

body {
background-color: #0aff0a;
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}

- AND -

body {
background-color: #0aff0a !important;
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}

- 还 -

body {background: #0aff0a}
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}

- AND -

body {background-color: #0aff0a}
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}

所有上述代码在fiddlesalad上测试完全正常。

我甚至尝试将以下内容直接添加到我的html文件中:

<style>
body {
background-color: #0aff0a !important;
</style>

如果我删除对CSS文件的引用并将其保留在我的html文件头中,则背景颜色会发生变化。那么,显然我的CSS文件中必须有覆盖身体背景颜色的东西?我肯定找不到它!

我的网页上没有任何可以覆盖它的内部CSS,我的样式表被正确引用并且工作正常。我已尝试清除缓存,并尝试在多个浏览器中查看...

以下是我正在处理的网站的链接:Sinister Serpents

非常感谢任何帮助或建议。

感谢。

3 个答案:

答案 0 :(得分:2)

在css文件中尝试覆盖背景颜色!important;

body {
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
background-color: #2e2e2e !important;
}

并确保最后将你的CSS链接到你的html头。

如果这不起作用,请尝试在内部样式表

中执行此操作

如果这也不起作用该怎么办? 暂时隐藏所有其他部分并尝试一下!

Goodluck!

答案 1 :(得分:0)

“fh5co-main”从我的角度来看,这个id会覆盖你的背景颜色。我不知道你要做什么。你能告诉我你想要的解决方案吗?

答案 2 :(得分:0)

哦,jeeeez ......我想通了,伙计们!我在cloudflare.com上登录了我的CDN并清除了我的所有文件,并且看到通过将背景颜色属性添加到&#34; fh5co-main&#34;来改变颜色。我开始觉得我在想着我!洛尔

非常感谢您的帮助!