From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../css/transform-function/rotatey()/index.html | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 files/zh-cn/web/css/transform-function/rotatey()/index.html (limited to 'files/zh-cn/web/css/transform-function/rotatey()/index.html') diff --git a/files/zh-cn/web/css/transform-function/rotatey()/index.html b/files/zh-cn/web/css/transform-function/rotatey()/index.html new file mode 100644 index 0000000000..b051527444 --- /dev/null +++ b/files/zh-cn/web/css/transform-function/rotatey()/index.html @@ -0,0 +1,107 @@ +--- +title: rotateY() +slug: Web/CSS/transform-function/rotateY() +translation_of: Web/CSS/transform-function/rotateY() +--- +
{{CSSRef}}
+ +

rotateY()  函数定义了一个转换,它可以让一个元素围绕纵坐标(垂直轴)旋转,而不会对其进行变形。它的结果是一个{{cssxref("<transform-function>")}} 数据类型。

+ +
{{EmbedInteractiveExample("pages/css/function-rotateY.html")}}
+ + + +

旋转轴围绕原点旋转,而这个原点通过{{cssxref("transform-origin")}} 属性来定义。

+ +
+

注意: rotateY(a) 相当于 rotate3d(0, 1, 0, a).

+
+ +
注意: 与二维平面上的旋转不同,三维旋转的组合顺序通常是不可交换的。换句话说,三维旋转的应用顺序,将会影响最终结果。
+ +

语法

+ +

rotateY() 引起的旋转量由{{cssxref("<angle>")}}指定。如果为正,则顺时针方向移动;如果为负,则逆时针方向移动。

+ +
rotateY(a)
+
+ +

参数值

+ +
+
a
+
a 是一个{{cssxref("<angle>")}} ,表示旋转的角度。正数角度表示顺时针旋转,负数则表示逆时针旋转。
+
+ + + + + + + + + + + + + + + + + +
笛卡儿坐标 ℝ2齐次坐标 ℝℙ2笛卡儿坐标 ℝ3齐次坐标 ℝℙ3
This transformation applies to the 3D space and can't be represented on the plane. cos(a)0sin(a)010-sin(a)0cos(a) cos(a)0sin(a)00100-sin(a)0cos(a)00001
+ +

示例

+ +

HTML

+ +
<div>Normal</div>
+<div class="rotated">Rotated</div>
+ +

CSS

+ +
div {
+  width: 80px;
+  height: 80px;
+  background-color: skyblue;
+}
+
+.rotated {
+  transform: rotateY(60deg);
+  background-color: pink;
+}
+
+ +

结果

+ +

{{EmbedLiveSample("示例", "auto", 180)}}

+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("CSS Transforms 2", "#funcdef-rotatey", "rotateY()")}}{{Spec2("CSS Transforms 2")}}Initial definition
+ +

浏览器兼容

+ +

有关兼容性信息,请参阅 <transform-function> 的数据类型。

+ +

另请参阅

+ + -- cgit v1.2.3-54-g00ecf