zoukankan      html  css  js  c++  java
  • css制作骰子

    <!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>
            *{
                margin:0;
                padding:0;
            }
            body,html{
                height:100%;
            }
            section{
                100%;
                height:100%;
                /* 触发弹性盒子 */
                display:flex;
                /* 主轴对齐方式 */
                justify-content:space-around;
                /* 侧轴居中 */
                align-items:center;
                /* 换行 */
                flex-wrap:wrap;
            }
            div{
                 100px;
                height: 100px;
                background: #e7e7e7;
                padding: 4px;
                box-shadow: inset 0 5px white, inset 0 -5px #bbb, inset 5px 0 #d7d7d7, inset -5px 0 #d7d7d7;
                border-radius: 10px;
            }
            span{
                display:block;
                 24px;
                height: 24px;
                background: #333;
                box-shadow: inset 0 3px #111, inset 0 -3px #555;
                border-radius: 12px;
                margin: 4px;
            }
            p{
                background:red;
            }
            /* 第一个div */
                /* div:nth-child(1){
                    display:flex;
                }
                div:nth-child(1) span{
                    margin:auto;
                } */
            div:nth-child(1){
                display:flex;
                /* 主轴居中 */
                justify-content:center;
                /* 侧轴居中 */
                align-items:center;
            }

            /* 第二个div */
            div:nth-child(2){
                display:flex;
                /* 主轴两端对齐 */
                justify-content:space-between;
            }
            div:nth-child(2) span:nth-child(2){
                align-self:flex-end;
            }

            /* 第三个 */
            div:nth-child(3){
                display:flex;
                /* Y轴为主轴 */
                flex-direction:column;
                /* 主轴对齐 */
                justify-content:space-between;
            }
            div:nth-child(3) span:nth-child(2){
                align-self:center;
            }
            div:nth-child(3) span:nth-child(3){
                align-self:flex-end;
            }

            /* 第四个 */
            div:nth-child(4){
                display:flex;
                /* 主轴对齐方式 */
                justify-content:space-between;
            }
            div:nth-child(4) p{
                display:flex;
                /* 改变主轴方向 */
                flex-direction:column;
                /* 主轴两端对齐 */
                justify-content:space-between
            }

            /* 第五个 */
            div:nth-child(5){
                display:flex;
                justify-content:space-between;
            }
            div:nth-child(5) p{
                display:flex;
                flex-direction:column;
                justify-content:space-between;
            }
            div:nth-child(5) p:nth-child(2){
                justify-content:center;
            }
        </style>
    </head>
    <body>
        <section>
            <div>
                <span></span>
            </div>
            <div>
                <span></span><span></span>
            </div>
            <div>
                <span></span>
                <span></span>
                <span></span>
            </div>
            <div>
                <p>
                    <span></span><span></span><span></span>
                </p>
                <p>
                    <span></span><span></span><span></span>
                </p>
            </div>
            <div>
                <p>
                    <span></span><span></span>
                </p>
                <p><span></span></p>
                <p>
                    <span></span><span></span>
                </p>
            </div>
            <div></div>
        </section>
    </body>
    </html>
    右侧打赏一下 代码改变世界一块二块也是爱
  • 相关阅读:
    详解PhpStudy集成环境升级MySQL数据库版本
    Mysql5.5升级到5.7的过程已经踩到的坑
    phpStudy中升级MySQL版本到5.7.17的方法步骤
    Windows上使用Vagrant打造Laravel Homestead可协同跨平台开发环境
    百度云下载加速的
    libsvm的安装,数据格式,常见错误,grid.py参数选择,c-SVC过程,libsvm参数解释,svm训练数据,libsvm的使用详解,SVM核函数的选择
    RBF神经网络的matlab简单实现
    spark mllib docs,MLlib: RDD-based API
    目前所有的ANN神经网络算法大全
    Spark1.6.1 MLlib 特征抽取和变换
  • 原文地址:https://www.cnblogs.com/ht955/p/15173152.html
Copyright © 2011-2022 走看看