盒模型布局

时间:2019-10-09
本文章向大家介绍盒模型布局,主要包括盒模型布局使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
<!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;
      width: 100%;
      height: 100%;
      display: flex;
      flex-flow: column;
      margin: 0 auto;
    }
    header{
      width: 100%;
      background: rgb(255,0,0);
      height: 60px;
    }
    main{
      width: 100%;
      background: blue;
      flex: 1;
      display: flex;
    }
    aside{
      width: 200px;
      background: cadetblue;
    }
    article{
      flex:1;
      background: yellow;
    }
    footer{
      width: 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