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中incr一个“0” 会报错?2. javascript - 最近用echarts做统计图时遇到两个问题!!3. android - 优酷的安卓及苹果app还在使用flash技术吗?4. nginx - 关于vue项目部署到ngnix后出现的问题5. css内联样式的style6. python - 使用scrapy框架爬百度图片被墙7. java - 一个泛型标签问题8. javascript - 如何使用Canvas改变素材的颜色?9. java类中的成员成员变量赋值之后什么时候会被回收,有什么办法监听到某一个对象被回收吗10. css - input中transition 设置background-color过渡,chrome浏览器页面初始化渲染会有过度效果

网公网安备