css - 前端flex布局嵌套內層的布局不起作用?
問題描述
<!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的標簽的高度就無法自適應了?該如何解決這個問題?
問題解答
回答1:修改一下入下圖的地方
謝謝,我怎么說我項目中的代碼不起作用,原來是多個分號。。。找的我好慘
相關文章:
1. css - 新手做響應式布局, 斷點過后右側出現空白,求幫助,謝謝。2. python - 能通過CAN控制一部普通的家用轎車嗎?3. javascript - ES6 中能否把 class 屬性 方法 分文件?4. python - 啟動Eric6時報錯:’qscintilla_zh_CN’ could not be loaded5. mysql - 查詢字段做了索引為什么不起效,還有查詢一個月的時候數據都是全部出來的,如果分拆3次的話就沒問題,為什么呢。6. mysql - 記得以前在哪里看過一個估算時間的網站7. ID主鍵不是自增的嗎 為什么還要加null8. 大家好,我想請問一下怎么做搜索欄能夠搜索到自己網站的內容。9. MySQL中的enum類型有什么優(yōu)點?10. css - 關于border-image
