弹性布局案例---骰子5

代码:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
        *{
            padding: 0;
            margin: 0;;
        }
            #contenier{
                display: flex;
                flex-direction: column;
                justify-content: stretch;
                align-items: center;
                height: 1000px;
            }
            .box1{
                display: flex;
                flex-direction: row;
                flex-grow: 1;
                justify-content: space-around;
                align-items: center;
                width: 100%;
            }
            .box2{
                border-radius: 200%;
                width: 30%;
                height: 80%;
                background-color: red;
                border: 1px solid #000000;
            }
            
        </style>
    </head>
    <body>
        <div id="contenier">
            <div class="box1">
            
                <div class="box2"></div>
                <div class="box2"></div>
            </div>
            <div class="box1">
                <div class="box2"></div>
                </div>
            <div class="box1">
                <div class="box2"></div>
                <div class="box2"></div>
                </div>
        </div>
    </body>
</html>
View Code

效果图:

 

 

 

posted @ 2021-12-04 16:13  坤k  阅读(84)  评论(0)    收藏  举报