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)了?該如何解決這個(gè)問題?
問題解答
回答1:修改一下入下圖的地方
謝謝,我怎么說我項(xiàng)目中的代碼不起作用,原來是多個(gè)分號(hào)。。。找的我好慘
相關(guān)文章:
1. docker gitlab 如何git clone?2. 關(guān)于docker下的nginx壓力測(cè)試3. 在windows下安裝docker Toolbox 啟動(dòng)Docker Quickstart Terminal 失敗!4. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。5. docker鏡像push報(bào)錯(cuò)6. PC 手機(jī)兼容的 編輯器7. angular.js - angularJs ngRoute怎么在路由傳遞空字符串及用ng-switch取得8. docker不顯示端口映射呢?9. docker-compose中volumes的問題10. mysql - 用PHPEXCEL將excel文件導(dǎo)入數(shù)據(jù)庫數(shù)據(jù)5000+條,本地?cái)?shù)據(jù)庫正常,線上只導(dǎo)入15條,沒有報(bào)錯(cuò),哪里的問題?
