【发布时间】:2017-09-13 22:44:46
【问题描述】:
容器内的 2 元素显示:块边距折叠,但显示:flex 不起作用! example
.wrapper {
width: 50%;
margin: 0 auto;
}
.container {
display: flex;
// display: block;
flex-flow: column nowrap;
background-color: green;
}
h1 {
background-color: #777;
margin-bottom: 20px;
}
p {
background-color: #ccc;
margin-top: 15px;
}
【问题讨论】:
-
也许我说错了。边距顶部底部应保持不变。 .container 必须具有 display:flex 不变。在 p 和 h1 上设置 display:flex 没有给出......并且没有改变 flex-wrap 。
-
您能否提供您正在寻找的图片或绘图?你的解释和评论不是很清楚
标签: css flexbox margin collapse