flex_高度补全
一个高度为100px, 另外一个高度自动补全当前界面下剩余的高度:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> html,body,.box{ height:100%; } body{ margin:0; } .box{ display:-webkit-flex; -webkit-flex-direction: column; display:flex; flex-direction:column; } .box .child{ height:40px; background:#f00; } .box .child1{ flex:1; background:#0f0 } </style> </head> <body> <div class="box"> <div class="child">child</div> <div class="child1">child1</div> </div> </body> </html>
只有在泥泞的道路上才能留下脚印