CodePen:http ://codepen.io/anon/pen/dYKGwV?editors=110
我有这个HTML:
<div class="Box Box--row" style="width: 20em; border: 1px solid black">
<div class="Box Box--column">Avatar</div>
<div class="Box Box--column">
<div class="Box Box--row">
<div class="Box">Name</div>
<div class="Box">6:30pm</div>
</div>
<div style="max-width: 100%; width: 100%;">
This is some text. This is some text. This is some text. This is some text. This is some text.
</div>
</div>
</div>
和CSS:
.Box {
box-sizing: border-box;
position: relative;
border: 0 solid black;
margin: 0;
padding: 0;
align-items: stretch;
justify-content: flex-start;
flex-shrink: 0;
display: flex;
&--row { flex-direction: row; }
&--column { flex-direction: column; }
}
但它的呈现方式是这样的:
它有点在Firefox中工作。如何获取要包装的文字?
为什么将flex-shrink设置为0?当我将其设置为1时,它可以正常工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句