小编Bra*_*xon的帖子

柔性包裹并均匀分布在行之间

问题演示

你好。上面显示的图像是一个按钮菜单(文本已被故意混淆)。菜单在功能上按预期将项目移动到第二行,但它并没有在行之间均匀地间隔项目。我在网上查找了解决方案,但它们要么不起作用(对我来说,有些甚至在它自己的小提琴中),要么它们限制太多。任何人都可以推荐一种使项目在两行(或多行)之间均匀分配的方法吗?

这是相关的 CSS:

#tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    background-color: rgb(50,50,50);
    justify-content: space-around;
}

#tabs button {
    background-color: <?php echo $style['buttonColor']; ?>;
    color: white;
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 18px;
    border: 1px solid black;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    cursor: pointer;
}
Run Code Online (Sandbox Code Playgroud)

css flexbox

6
推荐指数
1
解决办法
3596
查看次数

标签 统计

css ×1

flexbox ×1