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. 能用Nginx服务小型购物网站的web吗?2. javascript - input输入框的失去焦点事件和发送按钮的点击事件冲突3. javascript - jquery在相同class的按钮中选中一个 执行操作。4. html - 微信浏览器h5<video>标签问题5. android-studio - 如何在android module中使用Java 8的新特性,比如Lambda?6. 一道关于 JavaScript 中 this 的题目的困惑7. 用tp5框架写sql语句8. 百度地图api - Android百度地图SDK,MapView上层按钮可见却不可触,怎么解决?9. javascript - 正则表达式匹配,替换html标签里面的内容10. mysql每隔10来秒就有一次7、8MB的写入

网公网安备