MDN self-hosted library · e01.org

CSSRotate: angle property

CSS Typed Object Model API

Open notebook · 1 cells web-api-instance-property upstream source

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