div 与两者之间的空格并排



为什么两个div 并排且它们之间的空间很小如此困难?

我试过了

  <div style="height: 160px; width: 100%; box-sizing:border-box; display:table;">
            <div class="introwrapper" style="height:100%;    width:25%;display:table-cell;background: pink;box-sizing: border-box;">First      Div</div>
<div style="width:5%;">
 </div>
           <div class="introwrapper" style="height:100%; width:25%;display:table-cell; background: blue; box-sizing: border-box;">second div</div>
        </div>

但我无法在两者之间找到空间。它遍布SO和其他博客,但没有一个有正确的解决方案。

您可能需要

使用 float:left 将两个 DIV 并排放置对齐

<div style="height: 160px; width: 100%; box-sizing:border-box; display:table;">
    <div class="introwrapper" style="float:left;margin-right:30px; height:100%;    width:25%;display:table-cell;background: pink;box-sizing: border-box;">First      Div</div>
    <div class="introwrapper" style="float:left;height:100%; width:25%;display:table-cell; background: blue; box-sizing: border-box;">second div</div>
    <br style="clear:left" />
</div>

最新更新