-1
A
回答
1
你忘了創建/打開下降
<div class="col col2">
後
<div class="col col1">
</div> place <div class="col col2"> after the ending div of col col1
也與該更換你的CSS代碼:
html,body{
height:100%; /*Having 100% stretches your content, try removing height:100%; and see the difference*/
}
.parent{
padding:10px;
background:#888;
display:flex;
flex-wrap:wrap; /*Using flex-wrap:wrap will wrap your second div class to the next line*/
flex:1 0 auto;
}
.col1{
background:yellow;
}
.col2{
background:lightgreen;
}
相關問題
- 1. IE11錯誤地計算父級柔性容器的高度
- 2. 最小高度柔性盒容器
- 3. Twitter Bootstrap:100%容器高度的容器
- 4. 內容高度父容器的100%
- 5. 高度在絕對Flexbox的容器的柔性產品
- 6. 100%的高度溢出我的柔性佈局
- 7. 平等柔性柱高度絕對定位的容器
- 8. 柔性容器寬度適合內容寬度與柔性包裝:包裝?
- 9. 內部柔性盒父母div的高度爲100%
- 10. 使柔性物品具有100%的高度和溢出:滾動
- 11. 內容100%窗口高度的高度
- 12. 高度:100%不能在柔性箱內工作flex-grow
- 13. 當方向列的柔性容器中的父級柔性基礎設置時,父級高度未達到父級高度的柔性項的孩子
- 14. UL突破100%高度的容器
- 15. 幾個100%以下高度的容器
- 16. 溢出(滾動) - 100%的容器高度
- 17. Bootstrap 4 - 高度爲100%的容器
- 18. 粘性css頁腳與100%高度內容容器。
- 19. Div高度100%的內容
- 20. CSS具有最小高度的容器的100%高度
- 21. 測量TextInputLayout錯誤容器的高度
- 22. 100%高度溢出div容器
- 23. 100%容器高度問題--HTML5/CSS2/3
- 24. 100%容器高度與頁腳
- 25. JQuery Mobile內容高度:100%
- 26. 100%無內容高度
- 27. 高度:100%滿溢內容
- 28. 柔性盒項目的極限高度
- 29. 等高度柱 - 柔性盒和柔性包裝:包裝
- 30. 我如何設置柔性容器作爲其柔性項目的寬度?
http://stackoverflow.com/help/how-to-ask –