CSS offset-path Property

Beginner
⏱️ 7 min read
📚 Updated: Jun 2026
🎯 4 Examples
Animation & Motion

What You’ll Learn

The offset-path property defines the route an element follows during a motion path animation. It is the foundation for circle orbits, SVG curves, and custom shape-based movement.

01

Motion Route

Defines the path.

02

Syntax

Shapes and SVG paths.

03

circle()

Easy orbit paths.

04

path()

Custom SVG routes.

05

none Default

No path applied.

06

With distance

Pair with offset-distance.

Introduction

The offset-path property in CSS is used to define the path along which an element moves during an animation.

This path can be a basic shape, such as a circle or rectangle, or a more complex path defined using SVG path data.

The offset-path property is often used in conjunction with other properties like offset-distance and offset-rotate to create sophisticated motion effects.

Definition and Usage

Think of offset-path as drawing the track. Once the track exists, you can move an element along it by changing offset-distance.

Beginners usually start with circle() because it creates smooth orbital motion with very little code.

💡
Beginner Tip

Define offset-path first, then animate offset-distance from 0% to 100%.

📝 Syntax

The syntax for the offset-path property is as follows:

syntax.css
element {
  offset-path: value;
}

The value can be a basic shape, an SVG path, or the keyword none.

Basic Example

offset-path.css
.box {
  offset-path: circle(100px at 150px 150px);
  animation: move 5s linear infinite;
}

Syntax Rules

  • Use none to remove a motion path.
  • Use shape functions such as circle(), ellipse(), and polygon().
  • Use path() for custom SVG-style routes.
  • Combine with offset-distance to move along the defined route.

🎯 Default Value

The default value of the offset-path property is none, meaning that no path is defined for the element to follow.

Without a path, related motion properties such as offset-distance have no visible effect.

⚡ Quick Reference

QuestionAnswer
Initial valuenone
Applies toAll elements, but motion is visible with positioned or transformed elements
InheritedNo
AnimatableNo
Common useOrbits, curved routes, and decorative motion path animations

💎 Property Values

ValueExampleDescription
noneoffset-path: none;The element does not follow any path
path()path("M 10 80 C 40 10, 65 10, 95 80")Defines a path using SVG path data
circle()circle(50% at 50% 50%)Defines a circular path
ellipse()ellipse(50% 25% at 50% 50%)Defines an elliptical path
polygon()polygon(50% 0%, 100% 100%, 0% 100%)Defines a polygonal path
url()url("route.svg#path1")References an external SVG path resource

circle()

Best for simple orbit animations around a center point.

path()

Best for custom curves, borders, and complex routes.

ellipse()

Useful for oval-shaped motion around a focal point.

polygon()

Creates motion along triangle, diamond, or custom polygon edges.

circle() — orbit path() — SVG route ellipse() — oval path none — default

👀 Live Preview

This box follows a circular path created with offset-path: circle(...):

Examples Gallery

Define different path types, then animate movement with offset-distance.

⭕ Basic Shapes

Shape functions are the quickest way to create common motion routes.

Example 1 — Box Moving Along a Circular Path

In this example, a box moves along a circular path with a radius of 100px centered at 150px 150px.

circle-path.html
<style>
  .box {
    width: 50px;
    height: 50px;
    background-color: red;
    offset-path: circle(100px at 150px 150px);
    animation: move 5s infinite linear;
  }

  @keyframes move {
    from { offset-distance: 0%; }
    to { offset-distance: 100%; }
  }
</style>

<div class="box"></div>
Try It Yourself

How It Works

circle() creates the orbit, and the keyframes animate progress along that circular route.

Example 2 — Custom SVG path()

Use path() when you need a custom curve or border-like route.

svg-path.css
.dot {
  offset-path: path("M 10,80 Q 95,10 180,80 T 350,80");
  animation: follow 4s ease-in-out infinite alternate;
}

@keyframes follow {
  to { offset-distance: 100%; }
}
Try It Yourself

How It Works

The SVG-style path string defines the exact curve the element follows.

🔴 Advanced Shapes

Ellipses and polygons expand motion design beyond simple circles and lines.

Example 3 — Elliptical Path

An ellipse creates oval-shaped motion, useful for softer orbital effects.

ellipse-path.css
.orb {
  offset-path: ellipse(120px 60px at 160px 90px);
  animation: orbit 5s linear infinite;
}

@keyframes orbit {
  to { offset-distance: 100%; }
}
Try It Yourself

How It Works

The wider horizontal radius and shorter vertical radius produce an oval orbit instead of a perfect circle.

Example 4 — Triangle polygon() Path

A polygon path moves the element along the edges of a triangle.

polygon-path.css
.marker {
  offset-path: polygon(50% 0%, 100% 100%, 0% 100%);
  animation: trace 6s linear infinite;
}

@keyframes trace {
  to { offset-distance: 100%; }
}
Try It Yourself

How It Works

The three polygon points define a triangle route for the animated marker to follow.

Pair with offset-distance and offset-rotate

offset-path only defines the route. Use offset-distance to move along it and offset-rotate when the element should turn with the path direction.

motion-path-set.css
.badge {
  offset-path: circle(80px at 120px 80px);
  offset-distance: 0%;
  offset-rotate: auto;
  animation: orbit 4s linear infinite;
}

♿ Accessibility

  • Respect reduced motion — Disable path animations inside prefers-reduced-motion: reduce.
  • Keep motion decorative — Do not rely on path movement to communicate essential information.
  • Avoid distracting loops — Continuous motion can make nearby content harder to read.
  • Provide static fallbacks — Ensure the layout remains usable if motion paths are unsupported.

🧠 How offset-path Works

1

You define the route

Choose a shape function or SVG path() with offset-path.

Path
2

You move along the route

Animate or set offset-distance to control progress on the path.

Distance
3

You refine alignment

Use offset-anchor and offset-rotate when needed for better visual results.

Refinement
=

Custom motion paths

Elements follow circles, curves, and polygons without manual coordinate math.

Browser Compatibility

The offset-path property is supported in most modern browsers, including current versions of Chrome, Firefox, Safari, Edge, and Opera. Test your animations across browsers to ensure consistent behavior.

Baseline · Modern browsers

Reliable support for motion paths

Shape-based and SVG-style paths work well in up-to-date browser versions.

90% Modern browser support
Google Chrome 46+ · Desktop & Mobile
Full support
Mozilla Firefox 72+ · Desktop & Mobile
Full support
Apple Safari 15.4+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 33+ · Modern versions
Full support

Fallback behavior

When unsupported, the element remains in normal layout instead of following the defined path.

💻
Internet Explorer No support · Use transform-based animation fallbacks
None
offset-path property 90% supported

Bottom line: Use offset-path for modern decorative motion, with reduced-motion and fallback plans in place.

Conclusion

The offset-path property provides a powerful way to animate elements along predefined paths.

By leveraging various path definitions, such as circles, ellipses, and SVG paths, you can create dynamic and engaging animations. Experiment with different paths and combine offset-path with other properties like offset-distance and offset-rotate to achieve the desired motion effects for your web projects.

💡 Best Practices

✅ Do

  • Start with circle() for first motion path demos
  • Define the path before animating distance
  • Use path() for custom curves and borders
  • Test shape support across target browsers
  • Respect reduced-motion preferences

❌ Don’t

  • Expect movement without also setting offset-distance
  • Assume every path format behaves identically everywhere
  • Use complex motion when a simple transform would suffice
  • Forget fallback behavior for unsupported browsers
  • Make looping motion essential to understanding the UI

Key Takeaways

Knowledge Unlocked

Five things to remember about offset-path

Use these points when building motion path animations.

5
Core concepts
02

circle()

Easy orbit paths.

Shape
🛸 03

path()

Custom SVG routes.

Shape
04

none Default

No path applied.

Default
📏 05

offset-distance

Moves along path.

Companion

❓ Frequently Asked Questions

offset-path defines the route an element follows during a motion path animation, such as a circle, ellipse, polygon, or SVG path.
The default value is none, which means no motion path is applied.
Common values include path(), circle(), ellipse(), polygon(), url(), and the keyword none.
Usually yes. offset-distance moves the element along the path, and offset-rotate can control direction.
Yes. circle() is one of the easiest path formats for first motion path demos.

Practice in the Live Editor

Open the HTML editor, define an offset-path, and animate movement along your custom route.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful