2.12 平面转换

今天完成了安卓表的搭建:

今天继续学习html平面转换
skew() 用于倾斜元素,接受两个参数,分别表示水平和垂直方向的倾斜角度
代码示例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: purple;
            /* 先向右移动 50px,再顺时针旋转 45 度,最后水平和垂直方向都放大 1.2 倍 */
            transform: translate(50px) rotate(45deg) scale(1.2);
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>

还可以将多个转换组合在一起使用,通过空格分隔
代码示例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: purple;
            transform: translate(50px) rotate(45deg) scale(1.2);
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>
posted @ 2025-02-12 16:53  再报错就堵桥0  阅读(5)  评论(0)    收藏  举报