css中的角度单位有哪些?

<img alt=\"CSS中的角度单位有哪些?\” alt=\”css中的角度单位有哪些?\” src=\”https://www.freexyz.cn/d/file/20201120/b2a7615601a6b79dc7c4ba1027061e57.jpg\” />

css中的角度单位

1、deg

度(Degress)。一个圆共360度

90deg = 100grad = 0.25turn ≈ 1.570796326794897rad

66a88a852b2b095a01a6665ce48a588c

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
.test{
height:100px;background:#eee;
-moz-transform:rotate(2deg);
-webkit-transform:rotate(2deg);
-o-transform:rotate(2deg);
-ms-transform:rotate(2deg);
transform:rotate(2deg);
}
</style>
</head>
<body>
<div>transform:rotate(2deg);</div>
</body>
</html>

2、grad

梯度(Gradians)。一个圆共400梯度

90deg = 100grad = 0.25turn ≈ 1.570796326794897rad

1ef279c2466b4ff28dcdb2d9b3a7b02d

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
.test{
height:100px;background:#eee;
-moz-transform:rotate(2grad);
-webkit-transform:rotate(2grad);
-o-transform:rotate(2grad);
-ms-transform:rotate(2grad);
transform:rotate(2grad);
}
</style>
</head>
<body>
<div>transform:rotate(2grad);</div>
</body>
</html>

3、rad

弧度(Radians)。一个圆共2π弧度

90deg = 100grad = 0.25turn ≈ 1.570796326794897rad

83cd130e66ddd42184797d29b817976e

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
.test{
height:100px;background:#eee;
-moz-transform:rotate(2rad);
-webkit-transform:rotate(2rad);
-o-transform:rotate(2rad);
-ms-transform:rotate(2rad);
transform:rotate(2rad);
}
</style>
</head>
<body>
<div>transform:rotate(2rad);</div>
</body>
</html>

4、turn

转、圈(Turns)。一个圆共1圈

90deg = 100grad = 0.25turn ≈ 1.570796326794897rad

83e1af38987b7af68cc12fdfa6982728

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
.test{
height:100px;background:#eee;
-webkit-transform:rotate(.5turn);
-o-transform:rotate(.5turn);
-ms-transform:rotate(.5turn);
transform:rotate(.5turn);
}
</style>
</head>
<body>
<div>transform:rotate(.5turn);</div>
</body>
</html>
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容