Bootstrap:导航栏没有固定到顶部有40px填充?

arb*_*erb 8 html css twitter-bootstrap

我有一个twitter bootstrap的问题这是我的导航栏的样子: Bootstrap导航栏是bue

页面顶部与导航栏之间存在间隙.我试过用

.navbar {position:fixed!important; 顶部:0px; 填充:0px; 保证金:0px; }

在我的CSS文件中,但它仍然无法正常工作.它在移动和桌面上看起来像这样(具有响应性的css).我尝试将我的网站css放在响应式css之后,之前它没有做任何事情.有谁知道为什么会这样?

来自bootstrap.css的navbar数据:

.navbar-fixed-top,
.navbar-fixed-bottom {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 1030;
  margin-bottom: 0;
}

.navbar-fixed-top .navbar-inner,
.navbar-fixed-bottom .navbar-inner {
  padding-right: 0;
  padding-left: 0;
  -webkit-border-radius: 0;
     -moz-border-radius: 0;
          border-radius: 0;
}

.navbar-fixed-top .container,
.navbar-fixed-bottom .container {
  width: 940px;
}

.navbar-fixed-top {
  top: 0;
}

.navbar-fixed-bottom {
  bottom: 0;
}

.navbar .nav {
  position: relative;
  left: 0;
  display: block;
  float: left;
  margin: 0 10px 0 0;
}
Run Code Online (Sandbox Code Playgroud)

Eri*_*Mes 18

让你的身体,HTML没有任何填充,

html, body{
    margin:0px;
    padding:0px;
}
Run Code Online (Sandbox Code Playgroud)