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>
     
  • 相关阅读:
    win10+vs2010 安装Silverlight 安装说明
    常用小方法
    .net 技术学习进阶
    NetMQ——推拉模式 Push-Pull
    NetMQ使用——发布订阅模式 Publisher-Subscriber
    NetMQ使用——请求响应模式 Request-Reply
    跨终端Web
    七大排序算法
    JDK线程池
    Redis为什么这么快
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/12933437.html
Copyright © 2011-2022 走看看