column {display: flex; flex-direction: column}
column > * {border: 1px solid}
<column>
<flex1>1234567890</flex1>
<flex2>abc</flex2>
<flex3>...random length...</flex3>
</column>
上面没有完成我想做的事情。
答案 0 :(得分:1)
将inline-flex
和width:100%
用于弹性项目:
column {
display: inline-flex;
flex-direction: column
}
column>* {
width: 100%;
border:1px solid red;
}
<column>
<flex1>1234567890</flex1>
<flex2>abc</flex2>
<flex3>...random length...</flex3>
</column>
答案 1 :(得分:-1)
“列布局中的宽度相同”,我想是..
.parent {
display: flex;
}
.parent div {
border: 1px solid red;
flex-grow: 1;
flex-basis: 0;
text-align: center;
}
<div class="parent">
<div>1234567890</div>
<div>abc</div>
<div>...random length...</div>
</div>