gpt4 book ai didi

css - 如何在 visual composer WordPress 中将四个盒子排成两行而没有任何间隙?

转载 作者:行者123 更新时间:2023-11-27 23:09:04 25 4
gpt4 key购买 nike

我想把四个盒子排成两行。两行之间将没有填充/间隙。整个部分将被拉伸(stretch)。

框的例子如下: There are four boxes in two rows and each row has no space between them; all are attached together.

如何获得?请帮忙。提前致谢。

This is how I can did, but still there are lot spaces between each row

最佳答案

可以在VC中添加CUSTOM HTML模块,然后使用flex

html, body {
height: 100%;
margin: 0;
}
.grid2x2 {
min-height: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.grid2x2 > div {
display: flex;
flex-basis: calc(50% - 0px);
justify-content: center;
flex-direction: column;
}
.grid2x2 > div > div {
display: flex;
justify-content: center;
flex-direction: row;
}

.box { margin: 0px; }
.box1 { background-color: red; }
.box2 { background-color: orange; }
.box3 { background-color: purple; }
.box4 { background-color: grey; }
<div class="grid2x2">
<div class="box box1"><div>one</div></div>
<div class="box box2"><div>two</div></div>
<div class="box box3"><div>three</div></div>
<div class="box box4"><div>four</div></div>
</div>

关于css - 如何在 visual composer WordPress 中将四个盒子排成两行而没有任何间隙?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58628073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com