为什么我的叠加层覆盖了整个页面?

时间:2017-08-02 13:48:36

标签: css

我想要覆盖图片的叠加层正在覆盖我的整个背景,我不知道为什么,如果有人可以请求帮助

<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 个答案:

答案 0 :(得分:1)

添加此代码对您有帮助,

.main_head {
Position:relative;
}

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