zoukankan      html  css  js  c++  java
  • css-2D旋转

    css - 2D旋转

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <style>
            .xy {
                position: relative;
                 300px;
                height: 300px;
                border-top: 2px solid #000;
                border-left: 2px solid #000;
                margin: auto;
    
            }
    
            .xy::before {
                content: attr(metapoint);
                position: absolute;
                top: -20px;
                left: -20px;
                color: red;
            }
    
            .one {
                 200px;
                height: 200px;
                background-color: gray;
            }
    
            .one:hover::before {
                content: "移动到这儿了";
                display: block;
                 200px;
                height: 200px;
                background-color: #999;
                transform: translate(100px, 100px);
                /*
                transform: translate(x,y)
                x --> 水平 
                y --> 垂直
                不影响其他元素的位置
                行内标签没有效果
                */
            }
    
            .two {
                 150px;
                height: 150px;
                text-align: center;
                background-color: gray;
            }
    
            .two:hover::before {
                content: attr(data);
    
                text-align: center;
                display: block;
                text-align: center;
                 150px;
                height: 150px;
                background-color: #999;
                line-height: 150px;
                border-radius: 50%;
                border: 5px solid pink;
    
                /*顺时针旋转45度*/
                transform: rotate(45deg);
                /*transition: all 0.1s;*/
                /*
                transform: rotate(x,y)
                
                */
            }
    
            .three {
                position: relative;
                 249px;
                height: 35px;
                border: 1px solid gray;
            }
    
            .three::after {
                content: "";
                position: absolute;
                top: 7px;
                right: 15px;
                 10px;
                height: 10px;
                border-right: 1px solid #000;
                border-bottom: 1px solid #000;
                transform: rotate(45deg);
                transition: all 0.2s;
            }
    
            .three:hover::after {
                /*旋转的中心点位置*/
                transform-origin: left bottom;
                /*top: 15px;*/
    
                transform: rotate(225deg);
            }
    
            div:nth-of-type(n+5) {
                float: left;
                margin: 5px;
                height: 200px;
                 200px;
                background: #0000ff;
                overflow: hidden;
            }
    
            div:nth-of-type(n+5):after {
                content: "";
                display: block;
                height: 200px;
                 200px;
                background-color: green;
                transition: all 0.5s;
                transform: rotate(90deg);
                transform-origin: left bottom;
            }
    
            div:nth-of-type(n+5):hover::after {
                transform: rotate(0deg);
            }
    
        </style>
    </head>
    <body>
    <h1>transform CSS3 颠覆性特征之一
        <strong>位移</strong>
        <strong>旋转</strong>
        <strong>缩放</strong>
    </h1>
    
    <h2>2D 转化</h2>
    <h3>二维坐标系</h3>
    
    <div class="xy" metapoint="(0,0)">
    		
    </div>
    
    <h3>位移 translate</h3>
    <ul>
        <li>1. postion</li>
        <li>2. margin</li>
        <li>3.translate</li>
    </ul>
    <div class="one">
        原来盒子
    </div>
    
    <h3>旋转 rotate</h3>
    <div class="two" data="旋转盒子">
        原来盒子
    </div>
    
    <h3>制作三角形</h3>
    <div class="three">
    
    </div>
    
    <h3>旋转盒子排列</h3>
    <div></div>
    <div></div>
    <div></div>
    </body>
    </html>
    

      

  • 相关阅读:
    OpenCV -- CV_8UC1,CV_32FC3等参数的含义
    OpenCV -- 命名空间及相关函数介绍
    Qt -- QMutex使用详解
    QT -- 常用数据结构及函数
    Qt -- QQueue用法
    Qt -- QSetting类/ini配置文件的读写操作
    QT--日期操作QDateTime
    设备接口总汇(含实物图)
    “SurfFeatureDetector”: 未声明的标识符/不能实例化抽象类
    OpenCV -- Shi-Tomas角点检测与亚像素级角点检测
  • 原文地址:https://www.cnblogs.com/similarface/p/13489826.html
Copyright © 2011-2022 走看看