The offset-rotate property controls how an element turns while it travels along a motion path. It is what makes arrows, icons, and vehicles point in the direction they move.
01
Path Rotation
Turn with the route.
02
Syntax
auto, reverse, angle.
03
auto Default
Follow path direction.
04
Fixed Angle
Use deg or rad.
05
Curved Paths
Best on curves.
06
Motion Path Set
Works with offset-path.
Fundamentals
Introduction
The offset-rotate property in CSS is used to specify the rotation of an element along the motion path defined by the offset-path property.
This property allows you to control the orientation of an element as it moves along the path, enabling complex animations and dynamic visual effects.
It is particularly useful for animating elements along curved paths where maintaining a specific orientation is crucial.
Definition and Usage
Without offset-rotate, an element may slide around a circle or curve while staying upright. With offset-rotate: auto, the element turns to follow the path tangent.
Use a fixed angle when you want the element to keep the same rotation no matter how the path bends.
💡
Beginner Tip
Try offset-rotate: auto first on a circular path. It is the easiest way to see the property in action.
Foundation
📝 Syntax
The syntax for the offset-rotate property is as follows:
auto — The element rotates along the path, aligning with the path direction.
reverse — Similar to auto, but rotated 180 degrees relative to the path direction.
<angle> — A fixed rotation such as 45deg, 0.5rad, or 100grad.
Basic Example
offset-rotate.css
.box{offset-path:circle(80px at 120px 80px);offset-rotate:auto;animation:orbit 5s linear infinite;}
Syntax Rules
Define a path with offset-path before adjusting rotation.
Use auto when the element should point along the route.
Use a fixed angle when orientation should stay constant.
An optional second angle can add extra rotation in advanced cases.
Defaults
🎯 Default Value
The default value of the offset-rotate property is auto, which means the element’s rotation aligns automatically with the direction of the motion path.
That makes it a strong default for directional icons and shapes moving along curved routes.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
Elements with a defined offset-path
Inherited
No
Animatable
Yes, as an angle
Common use
Directional motion along curved paths
Reference
💎 Property Values
Value
Example
Description
auto
offset-rotate: auto;
Automatically aligns rotation with the path direction
reverse
offset-rotate: reverse;
Follows the path direction but rotated 180 degrees
Angle
offset-rotate: 45deg;
Uses a fixed rotation angle
Two angles
offset-rotate: auto 45deg;
Combines path alignment with an extra rotation offset
reverse is useful when the shape artwork faces the wrong way for auto.
Example 4 — Stay Upright with 0deg
Use 0deg when you want the element to slide along the path without turning.
zero-rotate.css
.label{offset-path:path("M 10,70 L 250,70");offset-rotate:0deg;animation:travel 3s linear infinite alternate;}@keyframestravel{to{offset-distance:100%;}}
The marker moves horizontally but keeps the same upright orientation throughout the animation.
Companion
Pair with offset-path and offset-distance
offset-rotate controls orientation only. You still need offset-path for the route and offset-distance to move along it.
motion-path-set.css
.arrow{offset-path:circle(80px at 120px 80px);offset-distance:0%;offset-rotate:auto;animation:orbit 4s linear infinite;}
A11y
♿ Accessibility
Respect reduced motion — Disable rotating path animations when prefers-reduced-motion: reduce is set.
Keep motion decorative — Do not rely on rotation alone to communicate important state.
Avoid disorienting spins — Fast rotating motion can be uncomfortable for some users.
Provide static fallbacks — Ensure content remains readable if motion path features fail.
🧠 How offset-rotate Works
1
The element follows a path
offset-path and offset-distance move the element along the route.
Motion
2
Rotation is applied
offset-rotate decides whether the element turns with the path or stays at a fixed angle.
Rotation
3
Orientation updates along the curve
With auto, the browser recalculates direction as the element travels around bends and corners.
Direction
=
🔀
Directional path animation
The element moves and points naturally along curved motion paths.
Compatibility
Browser Compatibility
The offset-rotate property is supported in most modern browsers, including Chrome, Firefox, Safari, and Edge. Test across browsers to ensure compatibility.
✓ Baseline · Modern browsers
Good support in current browsers
Motion path rotation works reliably in up-to-date Chrome, Firefox, Safari, and Edge versions.
88%Modern browser support
Google Chrome46+ · Desktop & Mobile
Full support
Mozilla Firefox72+ · Desktop & Mobile
Full support
Apple Safari15.4+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera33+ · Modern versions
Full support
Fallback behavior
When unsupported, the element may move without path-based rotation behavior.
💻
Internet ExplorerNo support · Use transform-based animation fallbacks
None
offset-rotate property88% supported
Bottom line: Use offset-rotate as progressive enhancement for directional motion path effects.
Wrap Up
Conclusion
The offset-rotate property provides fine-grained control over the orientation of elements as they move along a path.
This is especially useful for creating complex animations and ensuring that elements maintain a consistent orientation relative to their motion. Experiment with different values and combine them with other CSS properties to create dynamic and engaging animations on your web pages.