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>
     
  • 相关阅读:
    2018杭州初雪
    李宗盛
    张爱玲(句子迷)
    RFBnet论文笔记
    AXI总线简介、ID分析、DMA、Vivado烧录、系统集成
    axi总线之零:概述
    怎么理解 Redis 事务?
    Redis 集群最大节点个数是多少?
    怎么测试 Redis 的连通性?
    Redis 集群如何选择数据库?
  • 原文地址:https://www.cnblogs.com/ericblog1992/p/12933437.html
Copyright © 2011-2022 走看看