身体背景颜色没有显示?

use*_*719 8 html css

我只有一个简单的.shtml页面:

<html>
    <head>
        <meta charset='utf-8'>
        <meta content="IE=edge" http-equiv="X-UA-Compatible">
        <meta content="width=device-width, initial-scale=1" name="viewport">
        <link href="Stylesheets/main.css" rel="stylesheet">
        <link href="Stylesheets/glicons.css" rel="stylesheet">
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
        <title>
            Codepixl
        </title>
    </head>
    <body>
        <!--#include file="nav.html"-->
         asdsd
        <div id="Scripts">
            <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="Scripts/jquery.cookie.js"></script> <script src="Scripts/jquery-ui.min.js"></script> <script src="scripts/typed.js"></script> <script src="//codepixl.net/scripts/secret.js"></script>
        </div>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

和样式表:

body{
    background-color: #32CD32;
}
.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -115px;
  margin-left: -115px;
    z-index: 9999;
}
Run Code Online (Sandbox Code Playgroud)

但背景颜色没有出现?我尝试过使用html,body {}并使用doctype但没有任何效果!发生了什么?

编辑:我删除了bootstrap,它开始工作......还在这里的页面:http://codepixl.net/indesx.shtml

编辑:我只需要在样式表之前放置引导程序-_-

luk*_*evp 6

评论您的 Bootstrap 包含并查看是否应用了正文。您应该先尝试使用最少的代码进行测试,然后再添加一些东西。

如果这不起作用,您可以使用 Firefox 或 Chrome 中的检查器来查看应用了哪些 CSS 效果。

您可能还想使用 Chrome 中的网络检查器来确定您的样式表是否真的被下载或者链接是否不正确。


小智 6

通过添加`!important`覆盖Bootstrap的样式

body{
    background-color: #32CD32 !important;
}
Run Code Online (Sandbox Code Playgroud)


alm*_*ner 5

html {
    height: 100%;
}
body {
  background-color:#cccccc;
}
Run Code Online (Sandbox Code Playgroud)

这对我有用。如果没有在html中设置高度,body的background-color属性根本不起作用。