2013-02-13 40 views
0

我不能讓這個英雄單位對http://twitter.github.com/bootstrap/examples/hero.html#移動中心,喜歡用這種原始的CSS -英雄單位沒有顯示正確的

.hero-unit { 
    padding: 60px; 
    margin-bottom: 0px; 
    font-size: 18px; 
    font-weight: 200; 
    line-height: 30px; 
    color: inherit; 
    background-color: #eeeeee; 
    border:1px solid #cacaca; 
    -webkit-border-radius: 10px; 
    -moz-border-radius: 10px; 
      border-radius: 10px; 
} 

看看我做了http://www.magnixsolutions.com/dev/test/test.html

我的CSS是一樣的下面的原始文件。我不明白髮生了什麼事。

.hero-unit { 
    padding: 60px; 
    margin-bottom: 30px; 
    font-size: 18px; 
    font-weight: 200; 
    line-height: 30px; 
    background-color: #eeeeee; 
    border:1px solid #cacaca; 
    -webkit-border-radius: 10px; 
     -moz-border-radius: 10px; 
      border-radius: 10px; 
} 

回答

1

你錯過了兩件事情1

//從hero.html源代碼

body { 
    padding-top: 60px; 
    padding-bottom: 40px; 
} 

而另一種是

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

以上CSS是從http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css

使用上面然後檢查。

+0

是的,那正是我所錯過的 - 謝謝! – Christian 2013-02-13 15:15:50

0

你錯過了引導例如網頁上的一些重要資源:

body { 
    padding-top: 60px; 
    padding-bottom: 40px; 
    } 

由於導航欄固定在頂部,您將需要向下推動的主體內容,因此之後開始導航欄。在你的情況下,80px的頂部填充看起來更合適。

btw,jquery對於你的問題並不是一個真正有用的標記。

0

你有固定的標題,需要在body標籤上設置padding-top。