Reduced motion and motion paths
Definition and purpose
Motion paths position an element along a geometric path. Animation can vary that position over time, but decorative movement must respect user motion preferences. A reduced-motion alternative should preserve content and function without requiring the user to follow movement.
Static midpoint on a path
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } #p { position: relative; height: 80px; } #a { position: absolute; left: 0; top: 0; width: 20px; height: 20px; offset-path: path("M 10 10 L 110 10"); offset-distance: 50%; offset-rotate: 0deg; } </style> </head> <body> <div id="p"> <span id="a">●</span> </div> </body></html>The center of the 20px marker is at x=60, giving left edge x=50.
Syntax and mental model
offset-path defines the path, offset-distance specifies progress along it, and offset-rotate controls orientation. The example uses a simple SVG path string and a centered anchor. @media (prefers-reduced-motion: reduce) can remove optional animations and choose a stable position instead. This preference is not a request to hide information.
Optional movement
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { margin: 0; font: 16px sans-serif; color: #172033; background: white; } @keyframes travel { to { transform: translateX(80px); } } #a { display: inline-block; animation: travel 2s linear both; } @media (prefers-reduced-motion: reduce) { #a { animation: none; } } </style> </head> <body> <div id="p"> <span id="a">●</span> </div> </body></html>The marker remains visible even if the preference disables movement.
Common mistakes
Do not remove essential feedback along with decorative motion. A reduced-motion query is not a complete accessibility audit; consider pause controls and avoid flashing.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Multiple animations and interpolation. Next lesson: Custom properties and var.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Reduced motion and motion paths — knowledge check
Five questions on reduced motion and motion paths.
What defines the motion path geometry?
What places a marker halfway along a straight path?
What controls orientation on a path?
Which query detects a preference for less motion?
What should a reduced-motion variant preserve?