CSSRotate: angle property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("CSS Typed Object Model API")}} {{AvailableInWorkers}}

The **angle** property of the {{domxref("CSSRotate")}} interface represents the angle of rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.

Value

A {{domxref("CSSNumericValue")}}

Examples

Reading and setting the angle

js
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

{{Specifications}}

Browser compatibility

{{Compat}}

See also