网站建设知识
css如何设置对边平行
2025-07-04 15:42  点击:0

使用 CSS 如何设置对边平行?

使用display: flexjustify-content: space-between可以让多个元素的对边平行。

<div ><div ></div><div ></div><div ></div></div>
.container {display: flex;justify-content: space-between;}.box {width: 100px;height: 100px;background-color: #ccc;}

上面这段 CSS 代码就可以让多个宽度为 100px 的盒子在一个容器内平分容器的宽度,同时保持对边平行。