五点骰子

.box5 {
            justify-content: space-between;
        }

.box5 div {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }


注意选择器的优先级

.box5 .center {
            /* align-self: center; */
            justify-content: center;
        }

完整代码

    <style>
        /* 五点 */
        .box {
            padding: 12px;
            width: 100px;
            height: 100px;
            border: 1px solid black;
            border-radius: 8px;
            margin-bottom: 10px;
            display: flex;
        }

        span {
            width: 30px;
            height: 30px;
            background-color: black;
            border-radius: 15px;
        }

        .box5 {
            justify-content: space-between;
        }

        .box5 div {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .box5 .center {
            /* align-self: center; */
            justify-content: center;
        }
    </style>
</head>

<body>
    <div class="box box5">
        <div class="left">
            <span></span>
            <span></span>
        </div>
        <div class="center">
            <span></span>
        </div>
        <div class="right">
            <span></span>
            <span></span>
        </div>
    </div>
</body>
posted @ 2022-10-25 10:04  pocoui  阅读(36)  评论(0)    收藏  举报