zoukankan      html  css  js  c++  java
  • 2D转换

        /* x  y 轴 */
                /* transform: translate(100px, 100px); */
                /* transform: translate(100px, 0); */
                /* transform: translateX(100px); */
                /* transform: translateY(200px); */
     
    <!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>
            div {
                position: relative;
                 500px;
                height: 500px;
                background-color: pink;
                /* 可以使用 %,  50% 是自身一半 */
                /* transform: translateX(50%); */
            }
            /* 定位水平垂直居中 */
            
            p {
                position: absolute;
                top: 50%;
                left: 50%;
                 200px;
                height: 200px;
                background-color: purple;
                /* margin-top: -100px;
                margin-right: -100px; */
                transform: translate(-50%, -50%);
            }
        </style>
    </head>

    <body>
        <div>
            <p></p>
        </div>
    </body>

    </html>
     
  • 相关阅读:
    clearInterval,setInterval,clearTimeout,setTimeout
    input的onkeyup效果 超级简短代码
    yourphp点击刷新验证码
    收藏的插件
    js创建和获取cookie
    js blind使用
    js控制网页滚动条往下滚动
    document.body.scrollTop用法
    yourphp问题中心
    yourphp数据库介绍
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/12933437.html
Copyright © 2011-2022 走看看