两列响应式布局左右浮动:如何消除间隙?

问题描述

我正在尝试将响应式布局的以下容器以交替顺序分成两列。这是发生了什么的图表:

Graphic of the layout

这是在 JSfiddle 上:

Code on JSFiddle

有没有办法消除这些差距?如果不是,有什么替代方法可以将容器按照它们在代码中出现的原始顺序保留在移动设备上,并在桌面显示中将其中的一些内容放在一边(进入第二列)?

这是我目前的代码

    <html>
    
    <head>
    <style>
    #wrapper           {               width:200px;                                                }
    #div0-header       { height: 50px; width:100%;                           background:lime;      }
    #div1-sub-header   { height:100px; width: 50%; float:left;  clear:left;  background:yellow;    }
    #div2-navigation   { height: 75px; width: 50%; float:right; clear:right; background:orange;    }
    #div3-content      { height:100px; width: 50%; float:left;  clear:left;  background:red;       }
    #div4-about        { height: 50px; width: 50%; float:right; clear:right; background:fuchsia;   }
    #div5-footer       { height: 25px; width: 50%; float:left;  clear:left;  background:pink;      }
    #div6-copyright    { height: 15px; width: 50%; float:right; clear:right; background:lightblue; }
    </style>
    </head>
    
    <body>
    <div id="wrapper">
      <div id="div0-header">       0 header     </div>
      <div>
        <div id="div1-sub-header"> 1 sub-header </div>
        <div id="div2-navigation"> 2 navigation </div>
        <div id="div3-content">    3 content    </div>
        <div id="div4-about">      4 about      </div>
        <div id="div5-footer">     5 footer     </div>
        <div id="div6-copyright">  6 copyright  </div>
      </div>
    </div>
    </body>
    
    </html>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)