絕對定位的Flex項不會從IE11中的正常流中刪除。我們有兩個有內容的div和第三個div,這是一個絕對位置的背景。容器是一個柔性箱。在Chrome和Safari中都很好,但是Firefox和IE11因子在絕對定位的div中,并在div之間分配空間,就像連續(xù)有3 div一樣。我做過小提琴的例子。有辦法解決這個問題嗎?https://jsfiddle.net/s18do03e/2/div.container { display: flex; flex-direction: row; width: 100%; height: 300px; justify-content: space-between; width: 100%; outline: 1px solid;}div.c1 { background: #aaeecc; width: 100px; position: relative; z-index: 50; top: 20px; display: flex;}div.c2 { background: #cceeaa; width: 200px; position: relative; z-index: 50; top: 20px; display: flex;}div.bg { background: #ccc; width: 100%; height: 100%; z-index: 0; left: 0px; top: 0px; position: absolute; display: flex;}<div class="container"> <div class="c1">Content 1</div> <div class="c2">Content 2</div> <div class="bg">Background</div></div>
3 回答

慕沐林林
TA貢獻2016條經驗 獲得超9個贊
::before
::after
order
.c1 { order: -1;}.c2 { order: 10;}
order
flex
-1
::before
10
100
position: absolute
flex
添加回答
舉報
0/150
提交
取消