zoukankan      html  css  js  c++  java
  • 页面布局实例

    实例1

    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    #container {
        position: absolute;
        border: 1px solid blue;
        left: 10px;
        top: 10px;
        right: 10px;
        bottom: 10px;
    }
    #left {
        position: absolute;
        border: 1px solid red;
        width: 100px;
        left: 0px;
        top: 0px;
        bottom: 0px;
    }
    #right {
        position: absolute;
        border: 1px solid green;
        right: 0px;
        left: 100px;
        top: 0px;
        bottom: 0px;
    }
    #hide1 {
        position: absolute;
        border: 1px solid orange;
        width: 10px;
        left: 0px;
        top: 0px;
        bottom: 0px;
    }
    #main {
        position: absolute;
        border: 1px solid cyan;
        right: 0px;
        left: 10px;
        top: 0px;
        bottom: 0px;
    }
    #main-bottom {
        position: absolute;
        border: 1px solid purple;
        height: 200px;
        right: 0px;
        left: 0px;
        bottom: 0px;
    }
    #main-top {
        position: absolute;
        border: 1px solid pink;
        top: 0px;
        right: 0px;
        left: 0px;
        bottom: 200px;
    }
    #hide2 {
        position: absolute;
        border: 1px solid orange;
        height: 10px;
        left: 0px;
        right: 0px;
        bottom: 0px;
    }
    </style>
    </head>
    <body>
    <div id="container">
        <div id="left">
        </div>
        <div id="right">
            <div id="hide1">
            </div>
            <div id="main">
                <div id="main-top">
                    <div id="hide2">
                    </div>
                </div>
                <div id="main-bottom">
                </div>
            </div>
        </div>
    </div>
    </body>
    </html>
    <script>
    var hide1 = document.getElementById('hide1');
    var left = document.getElementById('left');
    var right = document.getElementById('right');
    hide1.onclick = function() {
        var interval = setInterval(function() {
                console.log(left.offsetWidth);
                left.style.width = left.offsetWidth - 10 + 'px';
                right.style.left = left.offsetWidth + 'px';
                if (left.offsetWidth < 10) clearInterval(interval);
            }, 100);
    }
    </script>
    View Code
  • 相关阅读:
    postman-3http请求
    postman-2get发送请求
    postman-1版本区别、选择
    mysql-13处理重复数据
    mysql-12序列使用
    mysql-11元数据
    mysql-10临时表、复制表
    10)global预定义变量
    9)用request方式
    8)post方式提交和简单那处理
  • 原文地址:https://www.cnblogs.com/feilv/p/4583978.html
Copyright © 2011-2022 走看看