zoukankan      html  css  js  c++  java
  • div 完美三等分(来源其他网站)

    来源http://www.jq22.com/jquery-info3251

    效果:

    代码:

    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
        <title></title>
    
        <style>
    
            * {
    
                margin: 0;
    
                padding: 0;
    
                font-size: 12px;
    
                font-family:'Microsoft YaHei';
    
            }
    
    
    
            #nav, #nav2 {
    
                /*盒模型*/
    
                display: -webkit-box;
    
                display: -moz-box;
    
                display: box;
    
                /**/
    
                margin: auto;
    
                margin-top:30px;
    
                border: 10px solid #7F8C8D;
    
            }
    
    
    
            #nav {
    
                width: 300px;
    
                height: 100px;
    
                /*横向*/
    
                -webkit-box-orient: horizontal;
    
                -moz-box-orient: horizontal;
    
                box-orient: horizontal;
    
            }
    
            #nav2 {
    
                width: 100px;
    
                height: 300px;
    
                /*纵向*/
    
                -webkit-box-orient: vertical;
    
                -moz-box-orient: vertical;
    
                box-orient: vertical;
    
            }
    
    
    
            #nav div,#nav2 div {
    
                /*占有比例*/
    
                -webkit-box-flex: 1;
    
                -moz-box-flex: 1;
    
                box-flex: 1;
    
    
    
                text-align:center;
    
                line-height:100px;
    
                font-size:36px;
    
                color:#fff;
    
            }
    
    
    
            #box1 {
    
                background: #1ABC9C;
    
            }
    
            #box2 {
    
                background: #3498DB;
    
            }
    
            #box3 {
    
                background: #9B59B6;
    
            }
    
    
    
            #box4 {
    
                background: #F39C12;
    
            }
    
            #box5 {
    
                background: #27AE60;
    
            }
    
            #box6 {
    
                background: #C0392B;
    
            }
    
        </style>
    
    </head>
    
    <body>
    
        <!-- 横向排列 -->
    
        <div id="nav">
    
            <div id="box1">1</div>
    
            <div id="box2">2</div>
    
            <div id="box3">3</div>
    
        </div>
    
        <!-- 纵向排列 -->
    
        <div id="nav2">
    
            <div id="box4">4</div>
    
            <div id="box5">5</div>
    
            <div id="box6">6</div>
    
        </div>
    
    </body>
    
    </html>
  • 相关阅读:
    计算机网络概述
    虚拟机网卡配置
    元类
    反射和内置方法
    面向对象的三大特性
    MYSQL中EXISTS的用法
    Guava中的常见集合操作用法
    集合操作交并补的三种Java实现
    P9 get和resize操作(Java 13)
    P8 Java 13中 HashMap的 put方法
  • 原文地址:https://www.cnblogs.com/jsbk/p/9442170.html
Copyright © 2011-2022 走看看