我从引导程序中覆盖了.navbar,如下所示:
.navbar {
margin-bottom: 0px !important;}
它有效地运行了一段时间,但由于错误,我不得不完全重写我的css文件,现在是这样的:
.navbar {
margin-bottom: 0px !important;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 80px;
background-color: #f5f5f5;
}
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #000;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 0px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -250px;
}
/* Sidebar Styles */
.sidebar-nav {
position: absolute;
top: 0;
width: 250px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
text-indent: 20px;
line-height: 40px;
}
.sidebar-nav li a {
display: block;
text-decoration: none;
color: #999999;
}
.sidebar-nav li a:hover {
text-decoration: none;
color: #fff;
background: rgba(255,255,255,0.2);
}
.sidebar-nav li a:active,
.sidebar-nav li a:focus {
text-decoration: none;
}
.sidebar-nav > .sidebar-brand {
height: 65px;
font-size: 18px;
line-height: 60px;
}
.sidebar-nav > .sidebar-brand a {
color: #999999;
}
.sidebar-nav > .sidebar-brand a:hover {
color: #fff;
background: none;
}
@media(min-width:768px) {
#wrapper {
padding-left: 250px;
}
#wrapper.toggled {
padding-left: 0;
}
#sidebar-wrapper {
width: 250px;
}
#wrapper.toggled #sidebar-wrapper {
width: 0;
}
#page-content-wrapper {
padding: 0px;
position: relative;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: 0;
}
}

我在网站上删除了除.footer和.navbar之外的所有模板。正如我所说,之前就是这样,一切正常。
我使用navbar类的代码的唯一部分就是这一部分:
{% block header %}
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<div class="navbar-brand-name">
<img alt="logo" width="80%" height="80%" src="bundles/exportail/images/logo.png" />
</div>
</a>
<p class="navbar-text"> Connected as : {{ app.user.username }}
-
<a href="{{ path('fos_user_security_logout') }}">Disconnected</a>
</p>
</div>
</div>
</nav>
{% endblock %}
当我使用谷歌检查工具检查这个div时,它会向我显示20px(默认值)的边距,即使我已经覆盖了我的.css中的值。 我这样打电话给我.css:
{% block stylesheets %}
<link href="bundles/exportail/css/pagelayoutonline.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
{% endblock %}
我已经做了一些搜索和网络,我没有找到任何真正有用的东西......如果你有任何线索,我会很感激!