Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/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 - Fatal编程技术网

Css 设置横幅背景色

Css 设置横幅背景色,css,twitter-bootstrap,Css,Twitter Bootstrap,我正在运行一个play框架(使用scala)教程,并按照前面提到的内容设置css。我得到白色背景的顶部横幅,而教程得到黑暗的背景。我是css新手,无法调试色差的原因 main.css是 body { color:black; } body, p, label { font-size:15px; } .label { font-size:13px; line-height:16px; } .alert-info { border-color:transparent; background-colo

我正在运行一个play框架(使用scala)教程,并按照前面提到的内容设置css。我得到白色背景的顶部横幅,而教程得到黑暗的背景。我是css新手,无法调试色差的原因

main.css是

body { color:black; }
body, p, label { font-size:15px; }
.label { font-size:13px; line-height:16px; }
.alert-info { border-color:transparent; background-color:#3A87AD;
color:white; font-weight:bold; }
div.screenshot { width: 800px; margin:20px; background-color:#D0E7EF; }
.navbar-fixed-top .navbar-inner { padding-left:20px; }
.navbar .nav > li > a { color:#bbb; }

.screenshot > .container { width: 760px; padding: 20px; }
.navbar-fixed-top, .navbar-fixed-bottom { position:relative; }
h1 { font-size:125%; }
table { border-collapse: collapse; width:100%; }
th, td { text-align:left; padding: 0.3em 0;
border-bottom: 1px solid white; }
tr.odd td { }
form { float:left; margin-right: 1em; }
legend { border: none; }
fieldset > div { margin: 12px 0; }
.help-block { display: inline; vertical-align: middle; }
.error .help-block { display: none; }
.error .help-inline { padding-left: 9px; color: #B94A48; }
footer { clear: both; text-align: right; }
dl.products { margin-top: 0; }
dt { clear: right; }
.barcode { float:right; margin-bottom: 10px; border: 4px solid white; }
而主体视图是

<head>
    <title>@title</title>
    <link rel="stylesheet" type="text/css" media="screen"
        href='@routes.Assets.at("stylesheets/bootstrap.css")'>
    <link rel="stylesheet" media="screen"
        href="@routes.Assets.at("stylesheets/main.css")">
</head>

<body>
    <div class="screenshot">

        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                <a class="brand" href="@routes.Application.index()">
                    @Messages("application.name")
                </a>
                </div>
            </div>
        </div>
        <div class="container">
            @content
            @debug()
        </div>
    </div>
</body>

@头衔
@内容
@调试()
应该是这样的

还有我的页面


我在“play for Scala”一书中找到了这个教程。css正在替换css main.css一些标签,你要做的是把main.css放在主体中{color:black important;!}

更改为

这是一个纯粹的css/HTML问题,不应该放在Scala或play标签下。CSS中没有任何内容描述该横幅的颜色。我怀疑一些CSS丢失了。您得到的颜色必须是bootstrap.CSS中CSS的结果。您所说的“在主体中放入main.CSS{color:black important;!}”是什么意思。是的,我注意到everywhere bootstrap.css正在取代main.css的css。虽然它起作用了,但我仍然不知道为什么第一个没有起作用,尽管你的建议起到了完美的作用。我检查了元素,并使用google chrome检查弹出窗口中的“computed”选项卡检查了它的颜色。这两次我都在里面看到了“身体-黑体-#333333”。