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. android - 安卓做前端,PHP做后台服务器 有什么需要注意的?2. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?3. mysql - 我用SQL语句 更新 行的时候,发现全部 中文都被清空了,请问怎么解决?4. python - xpath提取网页路径没问题,但是缺失内容?5. javascript - IOS微信audio标签不能通过touchend播放6. java中这个页面默认是utf-8编码的,1输出乱码可以理解,可是2就不理解了?7. python-mysql Commands out of sync8. docker不显示端口映射呢?9. javascript - 求教各位,本地HTML页面怎么在DIV中嵌套服务器上的页面内容?不用iframe。10. docker start -a dockername 老是卡住,什么情况?
