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. java固定键值转换,使用枚举实现字典?2. javascript - 移动端开发 H5 页面在 iOS手机上无法实现 长按复制文本 求解决3. 如何解决tp6在zend中无代码提示4. java - HTTPS双向认证基础上有无必要再进行加签验签?5. python - flask学习,user_syy添加报role is invalid keyword for User.6. vim - win10无法打开markdown编辑器7. java - 读写锁中 写锁的降级问题8. javascript - 有没有类似高铁管家的时间选择插件9. html - 如何使用用户输入的数据去运行一个数学公式,最后怎么返回。10. css - BEM 中块(Block)有木有什么标准 何时决定一个部分提取为块而不是其父级的元素呢(Element)?~
