zoukankan      html  css  js  c++  java
  • bjposition

    背景位置:background-origin:content-box;//"border-box", "padding-box", "content-box"

    <!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>
            #page
            {
               width:1024px; height:614px; margin:0 auto; background:url(Images/bg.png) no-repeat; -webkit-transform-style:preserve-3d; -webkit-perspective:2000;
            }
            #head
            {
                height:104px; line-height:104px; text-align:center;
            }
                #head input
                {
                    margin:0; padding:0 0 2px 0 ;border:none; background:url(Images/btn.png) no-repeat; width:92px; height:32px; font-size:12px; color:#666; text-shadow:1px 1px 1px #fff;
                }
            .box
            {
                width:583px; height:285px; border-width:9px;-webkit-border-image:url(Images/border_bg.png) 9; background:url(Images/1.png) no-repeat 0 0; padding:17px; margin:0 auto; background-origin:content-box;
            }
            #box1
            {
                opacity:0.2; margin-top:-330px; -webkit-transform-origin:bottom; -webkit-transform:rotateX(-180deg);
            }
        </style>
        <script>
            window.onload = function () {
                var aInput = document.getElementById("page").getElementsByTagName("input");
                var aDiv = document.getElementById("page").getElementsByTagName("div");
                var aArr = ["border-box", "padding-box", "content-box"];
                for (var i = 0; i < aInput.length; i++)
                {
                    aInput[i].onclick = function (b)
                    {
                        return function () {
                            toStyle(aArr[b]);
                        }
                    }(i);
                }
                function toStyle(val)
                {
                    for (var i = 1; i < aDiv.length; i++)
                    {
                        aDiv[i].style["backgroundOrigin"] = val;
                    }
                }
            }
        </script>
    </head>
    <body>
        <div id="page">
            <div id="head">
                <input type="button" value="Border" />
                <input type="button" value="Padding" />
                <input type="button" value="Content" />
            </div>
            <div id="box" class="box"></div>
            <div id="box1" class="box"></div>
        </div>
    </body>
    </html>
  • 相关阅读:
    JAVA_NIO 与Netty框架
    Socket编程
    P3368树状数组2(树状数组//改段求点)
    P3373 树状数组1(树状数组//改点求段)
    树状数组
    P1197 星球大战(并查集+链式向前星)
    P2024 食物链(种类并查集||带权并查集)
    P1111 修复公路(kruscal+并查集)
    P1387 最大正方形+P1736 创意吃鱼法(矩形上的dp+预处理)
    P2330 繁忙的城市(krusal最小生成树)
  • 原文地址:https://www.cnblogs.com/aimyfly/p/3154086.html
Copyright © 2011-2022 走看看