首页 > 其他分享 >Flex筛子布局

Flex筛子布局

时间:2024-03-22 21:44:22浏览次数:30  
标签:Flex 筛子 flex 布局 space face content display justify

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 分别调整每个面中的布局 */
        .first-face{
            display: flex;
            justify-content:center;
            align-items:center;
        }

        .second-face{
            display: flex;
            justify-content:space-between;
        }
        /* 单独调整第二面中的第二个圆点 */
        .second-face .circle:nth-of-type(2){
            align-self: flex-end;
        }

        .third-face{
            display: flex;
            justify-content: space-between;
        }
        .third-face .circle:nth-of-type(2){
            align-self: center;
        }
        .third-face .circle:nth-of-type(3){
            align-self: flex-end;
        }

        .forth-face{
            display: flex;
            justify-content: space-between;
        }
        /* 调整第四面中的所有列 */
        .forth-face .line{
            display: flex;
            flex-direction: column;
            justify-content: space-between;    
        }

        .fifth-face{
            display: flex;
            justify-content: space-between;
        }
        .fifth-face .line{
            display: flex;
            flex-direction: column;
            justify-content: space-between;    
        }
        /* 调整第五面中的第二列 */
        .fifth-face .line:nth-of-type(2){
            justify-content: center;
        }

        .sixth-face{
            display: flex;
            justify-content: space-between;
        }
        .sixth-face .line{
            display: flex;
            flex-direction: column;
            justify-content: space-between;    
        }
        
        *{
            box-sizing: border-box;
        }

        html,body{
            height: 100%;
        }

        body{
            /* 调整六个骰子的整体布局 */
            display: flex;
            align-items: center;
            justify-content: center;
            align-content: center;
            vertical-align: center;
            flex-wrap: wrap;
        }
        
        [class$="face"]{
            /* 凡是带有“face”,即第几面的调整 */
            width: 104px;
            height: 104px;
            background-color: whitesmoke;
            margin: 16px;
            padding: 4px;
            object-fit: contain;
             /* 将白色正方形的圆角变为十五度 */
            border-radius: 15%;
        }
        
        .circle{
            /* 圆点的设计 */
            width: 24px;
            height: 24px;
            /* 将小正方形的圆角变为五十度,变为圆点 */
            border-radius: 50%;
            margin: 4px;
            background-color: black;
        }
    </style>
</head>
<body>
    <div class="first-face">
        <div class="circle"></div>
    </div>

    <div class="second-face">
        <div class="circle"></div>
        <div class="circle"></div>
    </div>

    <div class="third-face">
        <div class="circle"></div>
        <div class="circle"></div>
        <div class="circle"></div>
    </div>

    <div class="forth-face">
        <div class="line">
            <!-- 定义一列来管理两个圆点 -->
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
        <div class="line">
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
    </div>

    <div class="fifth-face">
        <div class="line">
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
        <div class="line">
            <div class="circle"></div>
        </div>
        <div class="line">
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
    </div>

    <div class="sixth-face">
        <div class="line">
            <div class="circle"></div>
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
        <div class="line">
            <div class="circle"></div>
            <div class="circle"></div>
            <div class="circle"></div>
        </div>
    </div>
        
    
</body>
</html>

标签:Flex,筛子,flex,布局,space,face,content,display,justify
From: https://www.cnblogs.com/NaMialyzms/p/18088529

相关文章

  • 移动端 页面适配 原生js及lib-flexible 插件
    1.js原生;(function(win,doc){change()functionchange(){varremSize=window.innerWidth/7.5||50/*设计稿是以width=750px为基准的*/document.querySelector('html').style.fontSize=(remSize>100?100:remSize)+'px'}......
  • 【面试精讲】JVM 的内存布局和运行原理(附代码)
    【面试精讲】JVM的内存布局和运行原理(附代码)目录一、JVM内存布局1、堆(Heap)2、方法区(MethodArea)3、程序计数器(ProgramCounterRegister)4、虚拟机栈(VMStack)5、本地方法栈(NativeMethodStack)二、JVM运行原理1、类加载机制2、类加载机制详解2.1、 加载阶段2.2、......
  • 鸿蒙 HarmonyOS学习日记 Day 2 界面开发、布局
    文章目录一、界面开发1、代码书写方式2、界面开发-布局思路3、组件的属性方法4、文字溢出省略号、行高5、Image图片组件6、输入框与按钮四、综合实战-华为登录五、svg图标六、布局元素的组成二、单位问题一、界面开发1、代码书写方式1、代码块在build()方法中书......
  • C++ 多重继承下的内存布局
    1.多重继承多重继承示例代码如下:classBase1{public:voidf0(){}virtualvoidf1(){}inta;};classBase2{public:virtualvoidf2(){}intb;};classDerived:publicBase1,publicBase2{public:voidd(){}voidf2(){}......
  • Android常见界面布局
    用户界面UI设计与View类View类View是用户界面组件的共同父类,几乎所有的用户界面组件都是继承View类而实现的,如TextView、EditText、Button等。对View类及其子类的属性进行设置,可以在XML布局文件中设置,也可以通过成员方法在Java代码文件中动态设置。View类的常用属性与方法......
  • 前端必学-40个精选案例实战-案例9:企业首页实战项目【PC端网页布局】
    项目首页.psd项目设计图头部导航条的制作资源:html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,......
  • 【优化布局】机器学习求解4G网络无人机布局优化问题【含Matlab源码 4113期】
    ......
  • 鸿蒙的线性布局
    线性布局线性布局(LinearLayout)通过线性容器Column和Row创建Column容器:子元素垂直方向排列Row容器:子元素水平方向排列布局主方向上的对齐方式(主轴)属性:.justifyContent(枚举FlexAlign)(Row组件的justifyContent属性效果相似)1.Start    (排布主方向)主轴......
  • 第三章页面布局总结
    目录一.盒子模型 二.块级元素与行内元素1.块级元素​ 2.行内元素​3.行内块元素三.浮动与定位 1.元素浮动与清除​2.元素定位四.flex布局 1.容器属性(1)display(2)flex-direction(3)flex-wrap(4)flex-flow(5)justify-content(6).align-items(7).align-con......
  • html css 两栏 三栏布局
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device......