美文网首页
flex布局 筛子

flex布局 筛子

作者: 悟空你又瘦了 | 来源:发表于2019-03-01 22:35 被阅读0次
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        body{
            background-color: skyblue;
        }
        ul{
            background-color: whitesmoke;
            list-style: none;
            padding: 0;
            width: 90px;
            height: 90px;
            border: 1px solid gray;
            float: left;
            margin: 10px;
            border-radius: 10px;

            /* 开启弹性布局 */
            display: flex;
        }
        li{
            width: 20px;
            height: 20px;
            margin: 5px;
            background-color: gray;
            border-radius: 50%;
        }

        /*  二号 水平居中 */
        ul:nth-child(2){
            justify-content: center;
        }

        /*  三号 靠右 */
        ul:nth-child(3){
            justify-content: flex-end;
        }
        /*  四号 靠右 上下居中 */
        ul:nth-child(4){
            justify-content: flex-end;
            align-items: center;
        }
        /*  5号 左右居中 上下居中 */
        ul:nth-child(5){
            justify-content: center;
            align-items: center;
        }
        /*  6号 左右 靠边 */
        ul:nth-child(6){
            justify-content: space-between;
            
        }
        /*  7号 左右 靠边 第二个色子 在最下方 */
        ul:nth-child(7){
            justify-content: space-between;
        }
        ul:nth-child(7) li:nth-child(2){
            align-self: flex-end;
        }
        /*  8号 中间的色子 左右 上下居中 第三个 在右下角 */
        ul:nth-child(8){
            justify-content: space-between;
        }
        ul:nth-child(8) li:nth-child(2){
            align-self: center;
        }
        ul:nth-child(8) li:nth-child(3){
            align-self: flex-end;
        }
        /*  9号 从上往下排布 */
        ul:nth-child(9){
            justify-content: space-between;
            flex-direction: column;
        }
        /*  10号 从上往下排布 */
        ul:nth-child(10){
            flex-wrap: wrap;
            justify-content: space-between;
            align-content: space-between;
        }
        ul:nth-child(10) li{
            margin: 10px;
        }

        /*  11号 从上往下排布 */
        ul:nth-child(11){
            flex-wrap: wrap;
            justify-content: space-between;
            align-content: space-between;
        }
        ul:nth-child(11) li{
            margin: 5px 10px;
        }
        ul:nth-child(11) li:nth-child(3){
            margin: 5px 35px;
        }
        /*  11号 从上往下排布 */
        ul:nth-child(12){
            flex-wrap: wrap;
            flex-direction: column;
            align-content: space-around;
        }
        ul:nth-child(12) li{
            /*margin: 5px 10px;*/
        }
        ul:nth-child(12) li:nth-child(3){
            /*margin: 5px 35px;*/
        }
        /*  11号 从上往下排布 */
        ul:nth-child(13){
            flex-wrap: wrap;
            /*flex-direction: column;*/
            align-content: space-around;
        }
        ul:nth-child(13) li{
            /*margin: 5px 10px;*/
        }
        ul:nth-child(13) li:nth-child(3){
            /*margin: 5px 35px;*/
        }
    </style>
</head>
<body>
    <ul>
        <li></li>
    </ul>
    <ul>
        <li></li>
    </ul>
    <ul>
        <li></li>
    </ul>
    <ul>
        <li></li>
    </ul>
    <ul>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
</html>

相关文章

  • flex布局 筛子

  • flex布局

    认识flex布局 flex布局(Flexible 布局,弹性布局)开启了flex布局的元素叫flex contai...

  • flex 布局 实现三点筛子

  • 初见FLEX

    FLEX布局 一种新的布局方式,flex布局 flex布局与方向无关 flex布局可以实现空间自动分配、自动对齐。...

  • Flex 布局教程

    一、Flex 布局教程:语法篇 Flex 布局教程:语法篇 二、Flex 布局教程:实例篇 Flex...

  • css flex布局详解

    css flex布局详解 css flex布局详解1css flex布局详解2

  • Flex

    阮一峰-Flex布局 阮一峰-Flex布局实例教程 Flex布局 块级元素 行内元素 注意,设为 Flex 布局...

  • flex布局学习笔记

    经典教程 Flex 布局教程:语法篇Flex 布局教程:实例篇flex布局游戏 理解 flex布局实现需要至少两层...

  • 6Flex 布局

    Flex,(Flexible Box),意为"弹性布局"采用 Flex 布局的元素,为 Flex 容器(flex ...

  • css flex

    css flex布局 采用 Flex 布局的元素,称为 Flex 容器(flex container),简称“容器...

网友评论

      本文标题:flex布局 筛子

      本文链接:https://www.haomeiwen.com/subject/uoqckftx.html