flex 聖盃佈局


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<style>
  body{
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
  }
  #con{
    display: flex;
    height: 400px;
    background: green;
    align-items: center;
    flex: 1;
  }
  div{
    background: blue;
    height: 200px;
    align-self: auto
  }
  .middle{
    background: yellow;
    flex: 1;
  }
  .left{
    order: -1;
    flex: 0 0 200px
  }
  .right{
    flex: 0 0 220px
  }
</style>
<body>
  <div id="con">
    <div class="middle">222222222222</div>
    <div class="left">1111111111</div>
    <div class="right">333333333333</div>
  </div>
</body>
</html>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章