簡體   English   中英

在Twitter引導程序中的導航欄下方添加圖片

[英]Add image below navbar in Twitter bootstrap

由於行而導致我遇到Bootstrap問題:

<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="brand" href="/"></a>
        </div>
    </div>
</div>

<div id="main_top">
    <div class="container">
        <div class="row">
            <div class="span12">
                            ...

在main_top中,我有一個背景圖像。 由於以下代碼而導致我調整瀏覽器大小時會發生問題:

@media (max-width: 979px)
.navbar-fixed-top {
margin-bottom: 20px;
}

基本上,當瀏覽器寬度<979時,由於20px的空白,會有一條白線。

你能幫我解決嗎? 我還在這里創建了一個示例: http : //jsfiddle.net/TxRgF/

工作演示

那這個呢:

@media (max-width: 979px){
    body{
      padding-left:0 !important;
      padding-right: 0 !important;
    }

   .navbar-fixed-top {
      margin-bottom: 0px !important;
   } 

}

在該寬度下,主體具有左右填充物。 在CSS的末尾添加此類。

@media (max-width: 767px){
  body {
   padding-left:0 !important;
   padding-right: 0 !important;
 }
}

http://jsfiddle.net/simply_simpy/ryjMT/2/

您將需要向其他元素添加填充以進行補償。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM