flex 布局 实现三点筛子

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>flex 布局 实现三点筛子</title>
        <style>
        .box{
            width: 200px;
            height: 200px;
            padding: 20px;
            display: flex;
            flex-direction: row;
            justify-content: space-between; /*设置两端对齐*/
            border: 2px solid #ccc;
            border-radius: 10px;
        }
        .item{
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #666;
        }
        .item:nth-child(2){
            align-self: center; /*垂直方向居中*/
        }
        .item:nth-child(3){
            align-self: flex-end; /*垂直方尾对齐*/
        }

    </style>
    </head>
    <body>
    <div class="box">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    <div>
  </body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容