zoukankan      html  css  js  c++  java
  • 弹性盒模型

    1.display: -webkit-box;的应用

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .box{
                border: 10px solid #000;
                height: 100px;
                padding: 10px;
                /*display: -webkit-box;*/
            }
            .box div{
                height: 100px;
                width: 100px;
                background: red;
                border: 1px solid #fff;
            }
        </style>
    </head>
    <body>
        <div class="box">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
        </div>
    </body>
    </html>

    运行为:

    加上display: -webkit-box后,运行为:

    2.改变box的排序顺序

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .box{
                border: 10px solid #000;
                height: 100px;
                padding: 10px;
                font-size: 20px;
                display: -webkit-bo
            }
            .box div{
                height: 100px;
                width: 100px;
                background: red;
                border: 1px solid #fff;
            }
        </style>
    </head>
    <body>
        <div class="box">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
        </div>
    </body>
    </html>

    运行结果为:

    3.任意排列box的位置

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            .box{
                border: 10px solid #000;
                height: 100px;
                padding: 10px;
                font-size: 20px;
                display: -webkit-box;
                -webkit-box-direction:reverse;/*改变box的排序顺序*/
            }
            .box div{
                height: 100px;
                width: 100px;
                background: red;
                border: 1px solid #fff;
            }
            .box div:nth-of-type(1){-webkit-box-ordinal-group:2;}
            .box div:nth-of-type(2){-webkit-box-ordinal-group:3;}
            .box div:nth-of-type(3){-webkit-box-ordinal-group:6;}
            .box div:nth-of-type(4){-webkit-box-ordinal-group:1;}
            .box div:nth-of-type(5){-webkit-box-ordinal-group:4;}
            .box div:nth-of-type(6){-webkit-box-ordinal-group:5;}
        </style>
    </head>
    <body>
        <div class="box">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
        </div>
    </body>
    </html>

    运行结果为:

  • 相关阅读:
    行政区划遮罩 -Leaflet
    WebGIS vs WebGL图形编程
    oracle 中 group by 加强
    Nagios监控服务搭建
    MySQL触发器使用详解
    mybatis--一对多关联
    mybatis--一对一关联查询
    mybatis--实现数据库增删改查
    mybatis--使用接口注解的方式实现Helloword
    mybatis--第一个mybatis程序
  • 原文地址:https://www.cnblogs.com/pmlyc/p/8473590.html
Copyright © 2011-2022 走看看