CSS Typed Object Model API
The angle property of the CSSRotate interface represents the angle of rotation.
A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
Value
A CSSNumericValue
Examples
Reading and setting the angle
const rotate = new CSSRotate(CSS.deg(45));
console.log(rotate.angle.value); // 45
console.log(rotate.angle.unit); // "deg"
rotate.angle = CSS.deg(90);
console.log(rotate.toString()); // "rotate(90deg)"
Specifications
Browser compatibility
See also
- CSSRotate.CSSRotate
- CSSRotate.x
- CSSRotate.y
- CSSRotate.z
- Using the CSS Typed OM
- CSS Typed Object Model API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
