如何在 Bulma 中集中对齐列?
How can I centrally align columns in Bulma?
我正在尝试使用以下布局创建一个基于磁贴的仪表板(无需使用 Bulma 磁贴):
https://jsfiddle.net/foobarbazian/9szfn8db/2/
<div class="container">
<br>
<div class="columns is-multiline">
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">One</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
<div class="column is-3">
<div class="box has-background-danger">
<p class="title has-text-centered">Two</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">Three</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
</div>
</div>
但是我看到盒子左边有一个缝隙,比右边的缝隙小,每个盒子的底部也有一个缝隙。
如何确保内容很好地放置在每个框的中间?
.columns {
flex-wrap: wrap;
justify-content: space-between
}
.column.is-5 {
height: 100%;
}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<div class="container">
<br>
<div class="columns is-multiline">
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">One</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column box is-5">B</div>
<div class="column box is-5">C</div>
<div class="column box is-5">D</div>
</div>
</div>
</div>
</div>
我正在尝试使用以下布局创建一个基于磁贴的仪表板(无需使用 Bulma 磁贴):
https://jsfiddle.net/foobarbazian/9szfn8db/2/
<div class="container">
<br>
<div class="columns is-multiline">
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">One</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
<div class="column is-3">
<div class="box has-background-danger">
<p class="title has-text-centered">Two</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">Three</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column"></div>
<div class="column box is-5">B</div>
<div class="column"></div>
</div>
<div class="columns">
<div class="column box is-5">C</div>
<div class="column"></div>
<div class="column box is-5">D</div>
<div class="column"></div>
</div>
</div>
</div>
</div>
</div>
</div>
但是我看到盒子左边有一个缝隙,比右边的缝隙小,每个盒子的底部也有一个缝隙。
如何确保内容很好地放置在每个框的中间?
.columns {
flex-wrap: wrap;
justify-content: space-between
}
.column.is-5 {
height: 100%;
}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<div class="container">
<br>
<div class="columns is-multiline">
<div class="column is-3">
<div class="box has-background-success">
<p class="title has-text-centered">One</p>
<div>
<div class="columns ">
<div class="column box is-5">A</div>
<div class="column box is-5">B</div>
<div class="column box is-5">C</div>
<div class="column box is-5">D</div>
</div>
</div>
</div>
</div>