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. javascript - 单页面应用怎么监听ios微信返回键?2. angular.js - 在ionic下,利用javascript导入百度地图,pc端可以显示,移动端无法显示3. Android-studio导入.so库问题?4. utf-8 - python在windows命令行下生成文件乱码问题,如何解决?5. css3 - 为啥img的高度和a的高度不一样6. angular.js - 百度支持_escaped_fragment_吗?7. vue.js - vue apache 代理设置8. 我在centos容器里安装docker,也就是在容器里安装容器,报错了?9. node.js - Vue+Webpack在dev环境下没有问题build后出现莫名错误10. node.js - nodejs+express+vue
