MDN self-hosted library · e01.org

CSSRotate: x property

CSS Typed Object Model API

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

CSS Typed Object Model API

The x property of the CSSRotate interface represents the x-coordinate of the vector denoting the axis of rotation.

Value

A CSSNumericValue. If set to a number, this is wrapped in a CSSUnitValue of unit: "number".

Examples

Reading and setting the rotation axis

const rotate = new CSSRotate(1, 1, 0, CSS.deg(45));

console.log(rotate.x.value); // 1

rotate.x = 0;
console.log(rotate.x); // CSSUnitValue {value: 0, unit: "number"}

Specifications

Browser compatibility

See also