rotateY()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
尝试一下
transform: rotateY(0);
transform: rotateY(45deg);
transform: rotateY(-0.2turn);
transform: rotateY(3.142rad);
旋转轴围绕原点旋转,而这个原点通过transform-origin
属性来定义。
备注: rotateY(a)
相当于 rotate3d(0, 1, 0, a)
.
备注: 与二维平面上的旋转不同,三维旋转的组合顺序通常是不可交换的。换句话说,三维旋转的应用顺序,将会影响最终结果。
语法
参数值
笛卡儿坐标 ℝ2 | 齐次坐标 ℝℙ2 | 笛卡儿坐标 ℝ3 | 齐次坐标 ℝℙ3 |
---|---|---|---|
This transformation applies to the 3D space and can't be represented on the plane. |
示例
HTML
html
Normal
Rotated
CSS
css
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotateY(60deg);
background-color: pink;
}
结果
规范
Specification |
---|
CSS Transforms Module Level 2 # funcdef-rotatey |