css - 前端flex布局嵌套內(nèi)層的布局不起作用?
問題描述
<!DOCTYPE html>
<html lang='en'> <head><meta charset='UTF-8'><title>Document</title><style type='text/css' media='screen'> .box{ width: 200px; display: flex; height: 200px; background: skyblue; flex-direction: column;} .first{ height:30px; width: 200px; background: red;} .second{ flex-grow: 1; background: pink; style:flex;} .third{width:100%; height: 30px; background: yellow;} .fourth{ width: 100%; flex-grow: 1; background: gray }</style> </head> <body><p class='box'> <p class='first'></p> <p class='second'><p class='third'></p><p class='fourth'> </p> </p></p> </body></html>這樣做class為fourth的標(biāo)簽的高度就無法自適應(yīng)了?該如何解決這個問題?
問題解答
回答1:修改一下入下圖的地方
謝謝,我怎么說我項目中的代碼不起作用,原來是多個分號。。。找的我好慘
相關(guān)文章:
1. [前端求職必看]前端開發(fā)面試題與答案精選_擴展問題2. javascript - 在top.jsp點擊退出按鈕后,right.jsp進行頁面跳轉(zhuǎn),跳轉(zhuǎn)到login.jsp3. javascript - 下面的這段算法代碼求解釋4. mac連接阿里云docker集群,已經(jīng)卡了2天了,求問?5. css3 - 在sublime text里, 如何讓emmet生成的帶前綴css屬性垂直對齊?6. javascript - js 有什么優(yōu)雅的辦法實現(xiàn)在同時打開的兩個標(biāo)簽頁間相互通信?7. java - spring-data Jpa 不需要執(zhí)行save 語句,Set字段就可以自動執(zhí)行保存的方法?求解8. android - 哪位大神知道java后臺的api接口的對象傳到前端后輸入日期報錯,是什么情況?求大神指點9. javascript - angular中如何創(chuàng)建一個能被不同模塊中組件都能訪問其屬性和方法的對象10. 想找個php大神仿個網(wǎng)站。
