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. mysql - 分庫分表、分區、讀寫分離 這些都是用在什么場景下 ,會帶來哪些效率或者其他方面的好處2. 圖片鏈接的地址怎么獲得的3. python - 我在使用pip install -r requirements.txt下載時,為什么部分能下載,部分不能下載4. mysql - 如何減少使用或者不用LEFT JOIN查詢?5. mysql - jdbc的問題6. mysql - eclispe無法打開數據庫連接7. mysql 5個left關鍵 然后再用搜索條件 幾千條數據就會卡,如何解決呢8. 視頻文件不能播放,怎么辦?9. mysql - 千萬級數據的表,添加unique約束,insert會不會很慢?10. html5 - H5 audio 微信端 在IOS上不能播放音樂
