【CSS】复杂三栏布局

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    html,body{
      height: 100%;
    }
    .top,.bottom{
      width: 100%;
      height: 50px;
      background: #ccc;
    }
    .middle{
      height: calc(100% - 100px);
      background: #ffa4b2;
    }
    .left,.right{
        width: 100px;
        height: 100%;
        background: #0e3571;
        float: left;
    }
    .center{
        width: calc(100% - 200px);
        height: 100%;
        background: #b2c7ea;
        float: left;
    }
  </style>
</head>
<body>
<div class="top"></div>
<div class="middle">
  <div class="left"></div>
  <div class="center"></div>
  <div class="right"></div>
</div>
<div class="bottom"></div>
</body>
</html>

posted @ 2022-04-29 21:03  木子欢儿  阅读(24)  评论(0编辑  收藏  举报