2014-01-07 83 views
1

您可以看到傳送帶沒有觸摸導航欄。我想刪除它之間的餘量。我試過使用負邊距,他們似乎沒有工作。任何人都可以幫助我? http://i.stack.imgur.com/1htJM.png我將如何刪除圖像和Bootstrap導航欄之間的差距?

<!DOCTYPE html> 
<html> 
    <head> 
     <title>AwakenNetwork</title> 
     <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
     <link href = "css/bootstrap.min.css" rel = "stylesheet"> 
     <link href = "css/styles.css" rel = "stylesheet"> 
    </head> 
    <body> 

     <div id="wrap"> 

     <div class = "navbar navbar-default"> 
      <div class = "container"> 

       <a href = "#" class ="navbar-brand">AwakenNetwork</a> 

       <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse"> 
        <span class = "icon-bar"></span> 
        <span class = "icon-bar"></span> 
        <span class = "icon-bar"></span> 
       </button> 

       <div class ="collapse navbar-collapse navHeaderCollapse"> 

        <ul class = "nav navbar-nav navbar-right"> 

         <li class = "active"><a href = "#"><span class="glyphicon glyphicon-home"></span> Home</a></li> 
         <li><a href = "#"><span class="glyphicon glyphicon-bullhorn"></span> Forums</a></li> 
         <li><a href = "#"><span class="glyphicon glyphicon-gift"></span> Vote</a></li> 
         <li><a href = "#"><span class="glyphicon glyphicon-tower"></span> Staff</a></li> 
         <li><a href = "#"><span class="glyphicon glyphicon-book"></span> Rankings</a></li> 
         <li><a href = "#"><span class="glyphicon glyphicon-shopping-cart"></span> Store</a></li> 
        </ul> 

       </div> 
      </div> 
     </div>   
     </div> 

    <div style="height: 365px; background: url('https://dl.dropboxusercontent.com/s/246mjb1z7mahfe2/img1.jpg'); position: relative"> 
     <div class="carousel-caption" style="bottom: 15px"> 
       <h1 style="font-size: 100pt">Awaken Network</h1> 
       <h1>Be Awakened..</h1> 
      </div> 
+0

您是否在導航欄上嘗試過「margin-bottom:0」? – Andrew

+0

你的html似乎並不適用於你的開始 - 你似乎並沒有正確地在你的html底部關閉你的div(也許你的代碼塊被切斷了)。應該只有1個H1標籤也是,但這不會涉及到你的問題 – alfonsob

+0

放一個鏈接或創建一個Jsfiddle來查看問題。您的代碼未完成。 – ColoO

回答

3

你這樣做是正確的,請確保您使用

.navbar { margin-bottom:0px !important; } 
.carousel-caption { margin-top:0px !important } 
+0

修復它,謝謝。 – user3169590

0

保證金:0您導航UL:

HTML

<ul class="nav navbar-nav navbar-right"> 

CSS

ul.nav{ 
    margin: 0; 
} 

(或至少0在margin-top上)