2017-08-02 166 views
-3

我覆蓋IM希望設置在圖像會在我的整個背景,我只是不知道爲什麼,如果任何人都可以請幫助爲什麼我的覆蓋層覆蓋整個頁面?

<header class="main_head"> 
    <div class="navigation"> 
     <nav class="navbar navbar-default"> 
     <div class="container"> 
     <!-- Brand and toggle get grouped for better mobile display --> 
     <div class="navbar-header"> 
     <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> 
      <span class="sr-only">Toggle navigation</span> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
      <span class="icon-bar"></span> 
     </button> 
     <a class="navbar-brand" href="#">LOGO</a> 
     </div> 

     <!-- Collect the nav links, forms, and other content for toggling --> 
     <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
     <ul class="nav navbar-nav navbar-right"> 
      <li class="active"><a href="#"> Home <span class="sr-only">(current)</span></a></li> 
      <li><a href="#">About Us</a></li> 
      <li><a href="#">Services</a></li> 
      <li><a href="#">Sign Up</a></li> 
     </ul> 

     </div><!-- /.navbar-collapse --> 
     </div><!-- /.container-fluid --> 
     </nav> 
    </div> 

    <div class="main_info"> 
     <h1>Lorem Ipsum</h1> 
     <p class="lead">Lorem ipsum dolor sit amet, consectetur.</p> 
     <button type="button" id="odd_btn" class="btn btn-primary btn-lg">Primary1</button> 
     <button type="button" class="btn btn-primary btn-lg btn-spread">Primary</button> 
    </div> 
</header> 

http://imgur.com/ndb4hcU

css

+1

沒有你的CSS是不可能瞭解問題出在哪裏。 –

+0

有一個鏈接到css – Blee913

+1

請將實際的CSS放在問題中,而不是它的圖片。您可以通過將'position:relative;'添加到'.main_head'來解決您的問題。 –

回答

1

添加該代碼這是對你有幫助,

.main_head { 
Position:relative; 
} 

Add one more line " Position:relative" in .main_head{} css 
+0

好的謝謝我欣賞它 – Blee913