transform demo

本文详细介绍了使用CSS实现的四种不同的变换效果:旋转、平移、缩放和倾斜,并提供了具体的HTML和CSS代码示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6     <meta http-equiv="X-UA-Compatible" content="ie=edge">
 7     <title>Document</title>
 8     <style>
 9     .rotate {
10         margin: 100px 100px;
11         width: 200px;
12         height: 100px;
13         background-color: #3a9;
14         transform: rotate(80deg);
15         transform-origin: 0 0;
16     }
17     .translate {
18         margin: 50px 50px;
19         width: 200px;
20         height: 100px;
21         background-color: rgb(173, 179, 120);
22         transform: translate(300px, 50px )
23     }
24     .scale {
25         margin: 50px 50px;
26         width: 40px;
27         height: 40px;
28         border-radius: 50%; 
29         background-color: rgb(160, 231, 26);
30         transform: scale(2);
31         text-align: center;
32         line-height: 40px;
33             }
34     .skew {
35         margin: 50px 50px;
36         width: 50px;
37         height: 50px;
38         background-color: rgb(52, 35, 204);
39         transform: skew(70deg,0deg)
40     }
41     </style>
42 </head>
43 <body>
44     <div class="rotate"></div>
45     <div class="translate"></div>
46     <div class="scale"></div>
47     <div class="skew"></div>
48 </body>
49 </html>

 

转载于:https://www.cnblogs.com/gaoxuerong123/p/9463422.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值