0
Sup guys。我不能用块来制作页面,就像他们想要的一样。我有这个高块,称为“袋”的问题。我尝试了弹性盒,我尝试了浮动。也许有人可以帮助我把所有东西放在原来的位置上。将HTML放在正确的位置
figcaption
{
\t position: absolute;
\t width: 100%;
height: 41px;
\t bottom: 0px;
\t padding-top: 13px;
\t padding-left: 20px;
font-size: 21.333px;
font-family: "SegoeUIBold";
opacity: 0.8;
background-color: #FFF;
}
figure
{
\t position: relative;
\t cursor: pointer;
\t float: left;
\t margin-right: 10px;
\t margin-bottom: 10px;
}
<main>
<figure class="huge">
<img src="img/greenTshirt.png" alt="">
<figcaption>T-Shirts</figcaption>
</figure>
<figure class="normal">
<img src="img/cards.png" alt="">
<figcaption>Cards</figcaption>
</figure>
<figure class="normal">
<img src="img/pens.png" alt="">
<figcaption>Pens & Pencils</figcaption>
</figure>
<figure class="wide">
<img src="img/notebooks.png" alt="">
<figcaption>Notebooks</figcaption>
</figure>
<figure class="normal">
<img src="img/toys.png" alt="">
<figcaption>Toys</figcaption>
</figure>
<figure class="high">
<img src="img/bags.png" alt="">
<figcaption>Bags</figcaption>
</figure>
<figure class="normal">
<img src="img/scrum.png" alt="">
<figcaption>Scrum cards</figcaption>
</figure>
<figure class="normal">
<img src="img/magnets.png" alt="">
<figcaption>Magnets</figcaption>
</figure>
<figure class="big">
<img src="img/redCaps.png" alt="">
<figcaption>Caps</figcaption>
</figure>
<figure class="normal">
<img src="img/magnets.png" alt="">
<figcaption>Magnets</figcaption>
</figure>
<figure class="normal">
<img src="img/pens.png" alt="">
<figcaption>Pens & Pencils</figcaption>
</figure>
<figure class="normal">
<img src="img/toys.png" alt="">
<figcaption>Toys</figcaption>
</figure>
</main>
我认为这会更容易使用插件,像** [masonry](http://masonry.desandro.com)** –
确实。即使flexbox也可以做到这一点**和**保持你有的结构。这就是为什么砌体如此受欢迎。 –
@RamisWachtler谢谢,但砌体把所有东西都放在这样奇怪的顺序上,并且在块之间有很大的空间,我不确定它是否有帮助。 – newbie