当孩子不在窗外时,柔性盒子是否适合孩子的宽度?

时间:2019-01-31 08:43:11

标签: css flexbox

我使用的是column wrap布局,该页面将加载新内容并将其作为新的子元素附加到父box元素,因此我希望将auto fit的盒子宽度子元素。

此处的代码:https://codepen.io/mashirozx/pen/exgRqV

现在看起来是什么: enter image description here

我的希望(注意overflow-x栏): enter image description here


问题已解决:

overflow: auto添加到弹性框。

1 个答案:

答案 0 :(得分:0)

尝试更改:

flex-container-content > div {
  background-color: #EB213C;
  width: auto;
  margin: 10px;
  text-align: center;
  line-height: 75px;
  font-size: 30px;`

enter image description here