zoukankan      html  css  js  c++  java
  • flex简单参考实例

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <style type="text/css">
            .main {
                position: absolute;
                left: 0;
                top: 0;
                background-color: aquamarine;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                 100%;
                height: 100%;
            }
    
            .top {
                height: 60px;
                90%;
                background-color: red;
                text-align:center;
            }
            
            .container{
                 90%;
                background-color: gray;
                flex: 1; /**占据所有剩余空间**/
                text-align:center;
                display: flex;
            }
            
            .left, .right{
                100px;
                background-color:green;
                //flex:1;/**想要3个div均等划分就开放此设置**/
            }
            
            .center{
                flex:1;
            }
    
            .bottom {
                 90%;
                height: 60px;
                background-color: red;
                text-align:center;
            }
        </style>
    </head>
    <body>
        <div class="main">
            <div class="top">
                top
            </div>
    
            <div class="container">
              <div class="left">left</div>
              <div class="center">center</div>
              <div class="right">right</div>
            </div>
    
            <div class="bottom">footer</div>
        </div>
    </body>
    </html>

  • 相关阅读:
    3-1
    3-2
    习题二 8
    习题二 3
    习题二 5
    习题二 4
    习题二 6
    实验三-2未完成
    实验三
    心得
  • 原文地址:https://www.cnblogs.com/itjeff/p/10911380.html
Copyright © 2011-2022 走看看