Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
外部CSS:主体背景色赢得';不变_Css_Twitter Bootstrap 3_Background Color - Fatal编程技术网

外部CSS:主体背景色赢得';不变

外部CSS:主体背景色赢得';不变,css,twitter-bootstrap-3,background-color,Css,Twitter Bootstrap 3,Background Color,我无法在Bootstrap3网站上更改我的身体背景颜色。以下是我的外部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-s

我无法在Bootstrap3网站上更改我的身体背景颜色。以下是我的外部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;
}
-和-

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;
}
body {background-color: #0aff0a}
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}
-同时-

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;
}
body {background-color: #0aff0a}
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}
-和-

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;
}
body {background-color: #0aff0a}
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
color: #2e2e2e;
}
以上所有代码在Fiddle上都测试得非常好

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

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

身体{
背景色:#0aff0a!重要;
如果我删除对CSS文件的引用并将其保留在html文件的头部,背景颜色会发生变化。因此,很明显,CSS文件中肯定有什么内容覆盖了主体背景颜色?我肯定找不到它

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

以下是我正在工作的网站的链接:

如有任何帮助或建议,将不胜感激


谢谢。

“fh5co main”从我的角度来看,这个id正在覆盖你的背景色。我不知道你在尝试做什么。你能告诉我你正在寻找的解决方案吗?

在css文件中,尝试通过!重要信息

body {
font-family: 'Lato', arial, sans-serif;
font-size: 16px;
line-height: 1.5;
font-weight: 300;
background-color: #2e2e2e !important;
}
最后确保将css链接到html头部

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

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


祝你好运!

哦,天哪……我想出来了,伙计们!我登录了cloudflare.com上的CDN,清除了我所有的文件,你看,通过将背景色属性添加到“fh5co main”中,颜色变化很好。我开始觉得我是在胡思乱想!哈哈


非常感谢您的帮助!

您可能想了解。您是说最好复制/粘贴我的CSS文件的所有1600行吗?我认为我的示例非常精确…Hi Tawshif。谢谢您的回复。我已经尝试过更改“fh5co main”的背景色这也没用。我只是想控制我全身的背景色,这样我就可以尝试不同的背景色和纹理。你还有其他想法吗?这真是让我大吃一惊。我在Fiddle沙拉复制/粘贴了我的整个css文件,上面列出的任何背景色代码都会改变背景色很好。但是,它拒绝在站点上工作…从id=“fh5co main”中删除背景/背景色属性应该很好。在类中编写css规则是一个更好的实践,那么你能和我分享你的FiddleSala链接吗。我会尝试一下,我尝试过从“fh5co main”中完全删除背景色属性将其添加到body中,但仍然没有成功…我刚刚意识到,将背景图像属性添加到body中也不会起作用…谢谢Gururaj。正如我在原始帖子中提到的,我已经尝试使用“!important”覆盖它不起作用,而且我的CSS文件被正确引用。另外,我尝试在内部添加背景色属性…谢谢,但是…如果可能的话,请共享工作小提琴,这样我们就可以帮助您打开此链接并粘贴非工作代码,并在完成后通知我