简体   繁体   English

Div彼此垂直重叠(引导程序)

[英]Div's are overlapping each other vertically (Bootstrap)

I have three different divs that should be displaying one after the other, but they just jump right up to each other on the webpage. 我有三个不同的div,它们应该一个接一个地显示,但是它们只是在网页上彼此跳起来。 Here is the code for all of them: 这是所有代码的代码:

 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <div class="top-section"> <center> <div class="container" style="margin-top:150px;"> <div class="row"> <div class="top-title"> <h1>Introducing 10/40 Academy.</h1> <h3>An affordable entrepreneurship course that can double as high school credit.</h3> <img src="/Man_iPhone_Desk.jpg" style="height:300px;margin:30px;border-radius:4px;" class="raised hidden-xs" /><br> <a href="#showVideo" data-toggle="tab" class="halfraised btn btn-primary hidden-xs">Watch Video&nbsp;&nbsp;<span class="glyphicon glyphicon-play-circle"></span></a> <h3 class="hidden-sm hidden-xs" style="letter-spacing:2px;margin-top:0px;">SCROLL DOWN</h3> <h1 class="hidden-sm hidden-xs" style="font-weight:100;font-size:30px;"><span class="glyphicon glyphicon-chevron-down"></span></h1> </div> </div> </div> </center> </div> <div class="begin-tour"> <div class="container"> <div class="row"> <div class="col-md-6" style="margin-top:50px;"> <h2>Interested in small business?</h2> <h2>We're here to help.</h2> <p> Paragraph </p> </div> <div class="col-md-6"> <center> <img width="70%" src="/MacImageBase.png" /> </center> </div> </div> </div> </div> <div class="qualif"> <div class="container"> <div class="row"> <div class="col-md-6"> <h2>Header here</h2> <h2>Header</h2> <p> some text </p> </div> <div class="col-md-6"></div> </div> </div> </div> 

The best way to explain what happens is through a photo. 解释发生了什么的最好方法是通过照片。

在此处输入图片说明

I've added the 3 divs into the bootstrap container, took out center(it is not used anymore or supported by HTML5), put each div as a 12 column row(col-md-12 class) so they show up one after the other like you wanted: 我已将3个div添加到引导容器中,取出了中心(不再使用或不再受HTML5支持),将每个div设置为12列行(col-md-12类),因此它们在其他你想要的:

<div class="container">
  <div class="row">
    <div class="top-section  col-md-12">
      <div class="container" style="margin-top:150px;">
        <div class="row">
          <div class="top-title">
            <h1>Introducing 10/40 Academy.</h1>
            <h3>An affordable entrepreneurship course that can double as high school credit.</h3>
            <img src="/Man_iPhone_Desk.jpg" style="height:300px;margin:30px;border-radius:4px;" class="raised hidden-xs" /><br>
            <a href="#showVideo" data-toggle="tab" class="halfraised btn btn-primary hidden-xs">Watch Video&nbsp;&nbsp;<span class="glyphicon glyphicon-play-circle"></span></a>
            <h3 class="hidden-sm hidden-xs" style="letter-spacing:2px;margin-top:0px;">SCROLL DOWN</h3>
            <h1 class="hidden-sm hidden-xs" style="font-weight:100;font-size:30px;"><span class="glyphicon glyphicon-chevron-down"></span></h1>
          </div>
        </div>
      </div>
    </div>
    <div class="begin-tour col-md-12">
      <div class="container">
        <div class="row">
          <div class="col-md-6" style="margin-top:50px;">
            <h2>Interested in small business?</h2>
            <h2>We're here to help.</h2>
            <p>
              Paragraph
            </p>
          </div>
          <div class="col-md-6">
            <center>
              <img width="70%" src="/MacImageBase.png" />
            </center>
          </div>
        </div>
      </div>
    </div>
    <div class="qualif col-md-12">
      <div class="container">
        <div class="row">
          <div class="col-md-6">
            <h2>Header here</h2>
            <h2>Header</h2>
            <p>some text</p>
          </div>
          <div class="col-md-6"></div>
        </div>
      </div>
    </div>
  </div>
</div>

Here is the plunker so you can see it. 这是塞子,所以您可以看到它。

Please let me know if this helps. 请让我知道这可不可以帮你。 I didn't see your image until now so I hope it helps. 直到现在我都没有看到您的图片,希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM