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 關注
- 651 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消