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:修改一下入下图的地方
回答2:谢谢,我怎么说我项目中的代码不起作用,原来是多个分号。。。找的我好惨
相关文章:
1. angular.js - 在用会话存储传递参数时,使用angularjs冲突2. angular.js - angular2动态显示隐藏组件问题3. angular.js - angular 双向选框组件4. angular.js - AngularJS v1.5.8 在IE9中出现灰屏,不启动的问题。5. angular.js - angular 引入 jweixin的问题6. node.js - 怎么在初始化的时候使得一个子组件不加载?7. angular.js - 请教angularjs里html和js通信的问题8. angular.js - angular post的Content-Type被设置,导致不能上传图片,求助!!9. jquery - angularjs的数据为什么渲染不到页面上?数据获取到了,我的代码哪里出了错了?10. angular.js - 用angular2-cli打包项目之后,跳转路由刷新会报404的错误