2014-10-08 145 views
0

我通过Plural Sight上的视频跟踪,无法让导航栏停止隐藏我的文字(或我的文字在导航栏下移动)。手写笔导航栏覆盖文字

Navbar covering text

我有一个styl片如下:

body 
    padding-top 61px 

.navbar-header a.navbar-brand 
    margin-top -15px 
    margin-bottom -20px 
    h6 
    color #ccc 

footer 
    padding-left 15px 
    padding-right 15px 
    p 
    border-top 1px solid #d7e0e2 

index.jade一个如下:

extends ../includes/layout 

block main-content 
    .navbar.navbar-inverse.navbar-fixed-top 
     .container 
      .navbar-header 
       a.navbar-brand(href="/") MEAN Stack Tutorial 
        h6 -Extreme Tech Training 
     .navbar-collapse.collapse 
      .ul.nav.navbar-nav 
       li 
        a(href="/") Home 

    section.content 
     div(ng-view) 
    h2= mongoMessage 

     footer.container.text-center 
      p © 2014 BanksyCorp 

,最后一个layout.jade

doctype html 
html 
    head 
     title MEAN Stack Tutorial 
     base(href="/") 
     link(href='/favicon.ico', rel='shortcut icon', type='image/x-icon') 
     link(rel='stylesheet', href='/css/bootstrap.css') 
     link(rel='stylesheet', href='/vendor/toastr/toastr.css') 
     link(rel='stylesheet', href='/css/site.css') 
    body(ng-app='app') 
     block main-content 
     include scripts 

上的视频的例子,此代码应使内容出现在导航栏下方,就像这样:

Correct formatting

我知道styl文件被解析为我可以改变它的一些性质,看看它在浏览器中发生变化。

回答

1

这是因为你有一个navbar-fixed-top类,它具有position: fixed属性(块内容超出正常流程)。