• css利用flex布局画骰子的六个面


    主要是利用flex的一些特性来写的,掌握好flex基础,写出筛子的几个页面不是问题。
    推荐去我写的一个博客中有flex的小练习 线上练习flex布局

    html

    <body>
        <div class="shaizi">
            <div class="top">
                <div class="box1 box">
                    <span class="item"></span>
                </div>
                <div class="box2 box">
                    <span class="item"></span>
                    <span class="item"></span>
                </div>
                <div class="box3 box">
                    <span class="item"></span>
                    <span class="item"></span>
                    <span class="item"></span>
                </div>
            </div>
            <div class="bottom">
                <div class="box4 box">
                    <div class="box4_top">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                    <div class="box4_buttom">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                </div>
                <div class="box5 box">
                    <div class="box5_top">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                    <div class="box5_center">
                        <span class="item"></span>
                    </div>
                    <div class="box5_buttom">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                </div>
                <div class="box6 box">
                    <div class="box6_top">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                    <div class="box6_center">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                    <div class="box6_buttom">
                        <span class="item"></span>
                        <span class="item"></span>
                    </div>
                </div>
            </div>
        </div>
    </body>
    

    css

    <style>
        .shaizi {
             1400px;
            height: 600px;
            margin: auto;
            border: 2px solid #ddd;
            border-radius: 10px;
            padding: 20px;
            display: flex;
            flex-wrap: wrap;
            /* flex-direction: column;; */
        }
        .item {
            display: block;
             40px;
            height: 40px;
            border-radius: 50%;
            background-color: #666;
        }
        .box{
             200px;
            height: 200px;
            border: 2px solid #ccc;
            border-radius: 10px;
            padding: 20px;
            display: flex;
        }
        .top {
            display: flex;
             1400px;
            justify-content: space-around;
        }
        .bottom{
            display: flex;
             1400px;
            justify-content: space-around;
        }
        .box1 {
            justify-content: center;
            align-items: center;
        }
        .box2 {
            justify-content: space-between;
            align-items: center;
        }
        .box3 {
            justify-content: space-between;
            /* 两端对齐 */
        }
        .box3 .item:nth-child(2) {
            align-self: center;
            /* 上下左右居中对齐 */
        }
        .box3 .item:nth-child(3) {
            align-self: flex-end;
            /* 尾对齐 */
        }
        .box4 {
             flex-direction: column;
             justify-content: space-between;
        }
        .box4_top{
             200px;
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .box4_buttom{
             200px;
            height: 100px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .box5{
            flex-direction: column;
            justify-content: space-between;
        }
        .box5_top{
            display: flex;
            justify-content: space-between;
        }
        .box5_center{
            display: flex;
            justify-content: center;
        }
        .box5_buttom{
            display: flex;
            justify-content: space-between;
        }
        .box6{
            flex-direction: column;
            justify-content: space-between;
        }
        .box6_top{
            display: flex;
            justify-content: space-between;
        }
        .box6_center{
            display: flex;
            justify-content: space-between;
        }
        .box6_buttom{
            display: flex;
            justify-content: space-between;
        }
    </style>
    

    效果

  • 相关阅读:
    (七)策略模式详解
    (六)观察者模式详解(包含观察者模式JDK的漏洞以及事件驱动模型)
    递归锁,死锁,使用递归锁解决死锁,信号量
    并发编程中的GIL锁(全局解释器锁)自己理解的他为啥存在
    线程了解以及创建线程的Threading模块中的部分方法
    进程 >> 互斥锁、队列与管道、生产者消费者模型
    进程比较基础的内容
    基于UDP协议的socket套接字编程 基于socketserver实现并发的socket编程
    网络基础 + 简易服务端和客户端
    单例模式
  • 原文地址:https://www.cnblogs.com/loveliang/p/13722633.html
Copyright © 2020-2023  润新知