[英]Fill available space with or without flexbox
Inside my <main>
element I have divs, each with the class .dataCard
. 在我的
<main>
元素中,我有div,每个div都有一个.dataCard
类。 Each .dataCard
has the same minimum dimensions, but as soon as I started adding content to the .dataCard
s I noticed the layout behaving weirdly. 每个
.dataCard
都具有相同的最小尺寸,但是当我开始向.dataCard
添加内容时,我注意到布局.dataCard
。
The <main>
element is separated into two columns each containing a .dataCard
. <main>
元素分为两列,每列包含一个.dataCard
。 I did this because I need the order of the .dataCard
to go left-column, then one in right-column, one in left-column, and so on. 我这样做是因为我需要
.dataCard
的顺序为左列,然后为右列,左列,依此类推。
But when I fill the .dataCard
s with content they push all the other cards down underneath them. 但是,当我用内容填充
.dataCard
,它们会将所有其他卡向下推到它们下面。
How can I fill the available space with the .dataCard
s so that the <main>
element that contains them is as small in height as possible. 我该如何用
.dataCard
填充可用空间,以使包含它们的<main>
元素的高度尽可能小。
Right now, in the link below, there is the second card in the right column, but then a bunch of whitespace and at the end of the second-card the 3rd card in the left column starts. 现在,在下面的链接中,右列中有第二张牌,但是一堆空白,在第二张牌的末尾,左栏中的第三张牌开始了。
How can I move the left column up, or in other words, make the cards fit the available space with or without flexbox? 无论有无Flexbox,如何使左列向上移动,换句话说,使卡适合可用空间?
I would greatly appreciate any and all help! 我将不胜感激任何帮助!
Here is the link: https://googledrive.com/host/0BwJVaMrY8QdcVDBweWk2UXlfTVE/KE.html 这是链接:https://googledrive.com/host/0BwJVaMrY8QdcVDBweWk2UXlfTVE/KE.html
From your question I understand that you want to fill the entire page with boxes without any space. 根据您的问题,我知道您想用没有任何空格的框填充整个页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.