HTML使用栅格布局实现六种筛子样式的代码详解

这篇文章主要介绍了HTML使用栅格布局实现六种筛子的样式,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

先上效果图下面附上代码

HTML使用栅格布局实现六种筛子样式的代码详解


HTML使用栅格布局实现六种筛子样式的代码详解


HTML使用栅格布局实现六种筛子样式的代码详解

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            .big {
                width: 100px;
                height: 100px;
                background: skyblue;
                display: flex;
                margin-top: 20px;
            } 
            .small {
                width: 10px;
                height: 10px;
                background: purple;
                border-radius: 5px;
            }
            
            .one {
                display: flex;
                justify-content: center;
                /*交叉轴*/
                align-items: center;
            }
            
            .two {
                display: flex;
                justify-content: space-around;
                align-items: center;
            }
            
            .two2 {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                align-items: center;
            }
            
            .three {
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                align-items: center;
            }
            
            .four {
                display: flex;
                justify-content: space-around;
            }
            
            .four1 {
                display: flex;
                justify-content: space-around;
                align-items: center;
            }
            
            .four2 {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                align-items: center;
            }
            
            .five {
                display: flex;
                justify-content: space-around;
            }
            
            .five1 {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                align-items: center;
            }
            
            .five2 {
                display: flex;
                flex-direction: row;
                align-self: center;
            }
            
            .six {
                display: flex;
                justify-content: space-around;
            }
            
            .six1 {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                align-items: center;
            }
        </style>
    </head>

    <body>
        <div class="big one">
            <div class="small"></div>
        </div>
        <div class="big two">
            <div class="small"></div>
            <div class="small"></div>
        </div>
        <div class="big two2">
            <div class="small"></div>
            <div class="small"></div>
        </div>
        <div class="big three">
            <div class="small" style="align-self: flex-start;"></div>
            <div class="small" style="align-self: center;"></div>
            <div class="small" style="align-self: flex-end;"></div>
        </div>
        <div class="big three">
            <div class="small" style="align-self: flex-end;"></div>
            <div class="small" style="align-self: center;"></div>
            <div class="small" style="align-self: flex-start;"></div>
        </div>
        <div class="big four">
            <div class="four2">

                <div class="small"></div>
                <div class="small"></div>
            </div>
            <div class="four2">

                <div class="small"></div>
                <div class="small"></div>
            </div>
        </div>
        <div class="big five">
            <div class="five1">

                <div class="small"></div>
                <div class="small"></div>
            </div>
            <div class="five2">

                <div class="small"></div>
            </div>
            <div class="five1">

                <div class="small"></div>
                <div class="small"></div>
            </div>
        </div>

        <div class="big six">
            <div class="six1">
                <div class="small"></div>
                <div class="small"></div>
                <div class="small"></div>
            </div>
            <div class="six1">
                <div class="small"></div>
                <div class="small"></div>
                <div class="small"></div>
            </div>
        </div>
        <div class="big six">
            <div class="six1">
                <div class="small"></div> 
                <div class="small"></div>
            </div>
            <div class="six1">
                <div class="small"></div>
                <div class="small"></div> 
            </div>
            <div class="six1">
                <div class="small"></div>
                <div class="small"></div> 
            </div>
        </div>
    </body>

</html>

总结

到此这篇关于HTML使用栅格布局实现六种筛子的样式的代码详解的文章就介绍到这了,更多相关html 栅格布局 内容请搜索站长课堂以前的文章或继续浏览下面的相关文章,希望大家以后多多支持站长课堂!

声明:本站所有信息内容均由用户自行发表,该内容观点仅代表用户本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。Email:tellusa@foxmail.com

给TA打赏
共{{data.count}}人
人已打赏
html教程

HTML+CSS+JS模仿win10亮度调节效果的示例代码

2024-4-25 8:36:57

html教程

如何为 Element UI 里的 autosize textarea 设置高度

2024-5-10 7:30:20

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
有新私信 私信列表
搜索