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. 同一个html页面用多个id有什么影响?2. php工具箱配置第二个vhost主机时不生效,报错You don’t have permission3. javascript - ios返回不执行js怎么解决?4. 微信浏览器怎么取消缓存?5. mysql - sql subquery return more than 1 row6. android - 怎么adb logcat 输出到文件,并把文件命名为当前时间?7. ThinkPHP5实战之教学系统8. css - 在手机上背景显示的问题。9. android - 关于极光推送的通知的内容取出来的问题10. java - maven项目,每次使用update project都会把Dynamic Web Module变成3.1?

网公网安备