请在我的代码看这里:http://codepen.io/CrazySynthax/pen/NdJbmBCSS Flexbox的:如何使要素占据其容器的整个宽度的孩子
<table>
<div id="table-header">
<div class=header-square>SUN</div>
<div class=header-square>MON</div>
<div class=header-square>TUE</div>
<div class=header-square>WED</div>
<div class=header-square>THU</div>
<div class=header-square>FRI</div>
<div class=header-square>SAT</div>
</div>
</table>
html, body {
width: 100%
}
#table-header {
flex-direction: row;
display: flex;
width: 100%;
flex-wrap: wrap;
}
.header-square {
background-color: aqua;
border: solid;
height:100px;
display:flex;
}
我想那类的头方的元素将在整个传播容器的宽度,这意味着标题正方形的总宽度将是页面的100%。
我该如何做到这一点,而无需在css中明确定义标题 - 广场类的宽度?
谢谢。如果我想在高度上做同样的事情? – CrazySynthax
@CrazySynthax Check *编辑* – nashcheez
你能解释一下“flex:1”是什么吗? – CrazySynthax