Flex容器中的文本不会在IE11中包装考虑以下片段:.parent { display: flex; flex-direction: column; width: 400px; border: 1px solid red; align-items: center;}.child { border: 1px solid blue;}<div class="parent"> <div class="child"> Lorem Ipsum is simply dummy text of the printing and typesetting industry </div> <div class="child"> Lorem Ipsum is simply dummy text of the printing and typesetting industry </div></div>有已知的解决办法吗?
3 回答
侃侃无极
TA贡献2051条经验 获得超10个赞
.child { width: 100%; }
flex-basis: 100%
flex: 1
.parent { display: flex; flex-direction: column; width: 400px; border: 1px solid red; align-items: center;}.child { border: 1px solid blue; width: calc(100% - 2px); /* NEW; used calc to adjust for parent borders */}
<div class="parent"> <div class="child"> Lorem Ipsum is simply dummy text of the printing and typesetting industry </div> <div class="child"> Lorem Ipsum is simply dummy text of the printing and typesetting industry </div></div>
width: 100%
.
牛魔王的故事
TA贡献1830条经验 获得超3个赞
width:100%
, 保持一致
.child { align-self: stretch; }
.parent { align-items: stretch; }
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
max-width: 100%;
align-self: stretch
align-items: center
width: 100%
- 3 回答
- 0 关注
- 609 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消