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. redis sentinel怎么跑守护进程以及日志记录位置的?2. django - Nginx uwsgi 进程问题3. javascript - sublime快键键问题4. 前端 - 这段代码一直生效不了,查半天因为 top: 0px; 分号后一个隐藏的东西,也不是占位符...删了就可以生效,这是什么情况。。5. javascript - 解释下这种函数定义6. phpstudy 发现多个后门木马,有人遇到过吗?7. 关于纯用css写导航鼠标移入事件的问题?8. javascript - 求助关于js正则问题9. 微信小程序支持跳转到外部链接网页吗10. html5 - ElementUI table中el-table-column怎么设置百分比显示。

网公网安备