盒模型布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    *{
      padding: 0;
      margin:0;
    }
    html,body{
      height: 100%;
    }
    .app{
      background: #ccc;
       100%;
      height: 100%;
      display: flex;
      flex-flow: column;
      margin: 0 auto;
    }
    header{
       100%;
      background: rgb(255,0,0);
      height: 60px;
    }
    main{
       100%;
      background: blue;
      flex: 1;
      display: flex;
    }
    aside{
       200px;
      background: cadetblue;
    }
    article{
      flex:1;
      background: yellow;
    }
    footer{
       100%;
      background: rgb(0,255,0);
      height: 100px;
    }
  </style>
</head>
<body>
<div class="app">
  <header></header>
  <main>
    <aside></aside>
    <article></article>
  </main>
  <footer></footer>
</div>
</body>
</html>

  使用flex:1,可以填充空白部分

原文地址:https://www.cnblogs.com/bluecaterpillar/p/11641647.html