我有一个问题,其中块堆栈为2,接下来的2个块从前2个块的末尾开始.如此JSFiddle演示中所示.
HTML:
A div with less content than that one >A div with more content than the one on the left. Now Inline 3 goes down to where this div ends. I want to move it up however, so it's right under the div that's above Inline 3.Inline 3Inline 4
CSS:
.container { width:600px; background-color:rgb(40,40,40); } .inline { width:calc(50% - 22px); display:inline-block; vertical-align:top; color:white; background-color:#e74c3c; text-align:center; margin:5px 10px; }
输出:
注意: 这不会占用右上角div创建的空白区域.
预期/想要的输出:
注意: 这确实利用了空格.
我知道这可以用2列,但我不想使用2列.因为我必须能够在列中没有不相等的内容的情况下删除一些div.