雙飛翼佈局

<!DOCTYPE html>
<html lang="zh">

  <head>
    <meta charset="UTF-8">
    <title>已知寬高元素水平垂直居中</title>
    <style>
    *{
      margin:0;
      padding: 0;
    }

    .left{
        float: left;
        width:100px;
        background: red;
        margin-left: -100%;

    }
    .center{
        float: left;
        width:100%;
        background: blue;


    }
    .inner{
        margin:0 100px;
    }
    .right{
          float: left;
          width:100px;
          background: green;
          margin-left: -100px;

    }
    </style>
  </head>

  <body>
  <div class="main">
          <div class="center">
              <div class="inner">center</div>
          </div>
        <div class="left">left</div>
        <div class="right">right</div>
</div>
  </body>


</html>

複製代碼
相關文章
相關標籤/搜索