html – 引导行之间的垂直空间

前端之家收集整理的这篇文章主要介绍了html – 引导行之间的垂直空间前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
所以我正在进行布局,为了“响应”,我决定使用Bootstrap.现在我猜我的网格系统有问题.

我想要的结果如下:

|-----------|       |---------------------------------|
|     1     |       |                                 | 
|-----------|       |                                 |
                    |                4                |
|-----------|       |                                 |
|     2     |       |                                 |
|-----------|       |---------------------------------|

|-----------|
|     3     |
|-----------|

但那并没有发生.发生的事情是我在方框1和方框2之间有一个令人不快的垂直空白,它持续到方框4的结尾.在这里看一个真实的例子:

这就是发生的事情.方框1和方框2之间的空间跨越直到方框4的结尾.

这是我的HTML:

<div class="row">
    <div class="col-md-4 nopadding leftnews">
        <div id="radio">
            <audio id="radio-audio" controls="" autoeplay="" preload="none">
                <source src="#" type="audio/mpeg">
            </audio>
            <div id="stats" style="background-image: url('assets/img/test.png');">
                <span class="dj-name">*****</span>
                <span class="listeners">30</span>
                <span class="song"><marquee id="song">Katy Perry - Thinking Of You (Acoustic Version)</marquee></span>
            </div>
            <div id="player">
                <div class="volume">
                    <input name="volume-control" id="volume-control" type="range" min="0" max="99" value="100" step="1" onchange="volumeUpdate(value)">
                </div>
                <img id="audio-update" src="assets/img/radio_update.png" alt="">
                <div id="audio-play" class="radio-control"></div>
                <div id="audio-pause" class="radio-control"></div>
            </div>
        </div>
    </div>

    <div class="col-md-8 nopadding">
        <div class="panel panel-default panel_big">
            <div class="panel_top_orange"></div>
            <div class="panel-body">
                Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes,nascetur ridiculus mus. Donec quam felis,ultricies nec,pellentesque eu,pretium quis,sem. Nulla consequat massa quis enim. Donec pede justo,fringilla vel,aliquet nec,vulputate eget,arcu. In enim justo,rhoncus ut,imperdiet a,venenatis vitae,justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula,porttitor eu,consequat vitae,eleifend ac,enim. Aliquam lorem ante,dapibus in,viverra quis,feugiat a,tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-4 nopadding">
        <div class="panel panel-default panelsmall">
            <div class="top_rooster">
                <span>Rooster</span>
            </div>
            <div class="panel-body">
                <div id="rooster">
                    <table style="width:265px;">
                        <tr class="current" title="11:00 - 13:00" data-toggle='tooltip'>
                            <td>
                                <img src="assets/img/test.png" style="position: relative; top:-5px;" />
                            </td>
                            <td class="nu"><b>NU</b>: </td>
                            <td> </td>
                            <td class="djnu"> ****</td>
                        </tr>

                        <tr title="12:00 - 13:00" data-toggle='tooltip'>
                            <td>
                                <img src="assets/img/test.png" style="position: relative; top:-5px;" />
                            </td>
                            <td class="nu">HIERNA: </td>
                            <td> </td>
                            <td class="dj"> ****</td>

                        </tr>
                        <tr title="13:00 - 14:00" data-toggle='tooltip'>
                            <td >
                                <img src="assets/img/test.png" style="position: relative; top:-5px;" />
                            </td>
                            <td class="nu">STRAKS: </td>
                            <td> </td>
                            <td class="dj"> ****</td>
                        </tr>
                    </table>    
                </div>
            </div>
        </div>
    </div>
</div>

快速回顾一下代码

我有一排,在那一排,有一个col-md-4指向方框1.然后在同一行,有一个col-md-8指向方框4.
在该行下,有一个包含col-md-4的新行(方框2).

怎么修这该死的空间?这真烦人……

谢谢.

(如果我写了一个模糊的问题,我很抱歉.我试图尽可能多地了解它)

解决方法

为什么不将屏幕划分为两列,.col-md-4和col-md-8,并将第1,2和3栏的内容放入左栏?一个小于md的屏幕,这将使盒子成为容器的100%并按升序排列.
.Box {
  border: 1px solid #c66;
  background-color: #f99;
  margin-bottom: 15px;
  height: 100px;
  line-height: 100px;
  color: #fff;
  font-family: Helvetica,Arial,sans-serif;
  font-size: 48px;
  text-align: center;
}
.Box--high {
  height: 250px;
  line-height: 250px;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" />

<div class="container">
  <div class="row">
    <div class="col-md-4">
      <div class="Box">1</div>
      <div class="Box">2</div>
      <div class="Box">3</div>
    </div>
    <div class="col-md-8">
      <div class="Box Box--high">4</div>
    </div>
  </div>
</div>

猜你在找的HTML相关文章