本教程操作环境:windows10系统、css3&&html5版、dell g3电脑。
css3怎样用rotate设置旋转角度transform 属性向元素应用 2d 或 3d 转换。该属性允许我们对元素进行旋转、缩放、移动或倾斜。
该属性可以配合rotate()函数来设置旋转角度。
rotate()函数定义 2d 旋转,在参数中规定角度。
示例如下:
<!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>document</title> <style> div{ width:100px; height:100px; border:1px solid #000; transform:rotate(45deg); } </style></head><body> <div></div></body></html>
输出结果:
(学习视频分享:css视频教程)
以上就是css3怎样用rotate设置旋转角度的详细内容。
