{"id":243593,"date":"2016-07-22T10:51:02","date_gmt":"2016-07-22T17:51:02","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=243593"},"modified":"2016-10-19T09:51:01","modified_gmt":"2016-10-19T16:51:01","slug":"offset-distance","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/o\/offset-distance\/","title":{"rendered":"offset-distance"},"content":{"rendered":"
This property began life as motion-offset<\/code>. This, and all other related motion-* properties, are being renamed offset-* in the spec<\/a>. We’re changing the names here in the almanac. If you want to use it right now, probably best to use both syntaxes.<\/div>\n

The motion-offset<\/code> property in CSS says: how far along the motion-path<\/code><\/a> are you? This is the animatable<\/strong> property associated with motion paths. <\/p>\n

.thing-that-moves {\r\n  \/* \"Old\" syntax. Available in Blink browsers as of ~October 2015 *\/\r\n  motion-path: path('M 5 5 m -4, 0 a 4,4 0 1,0 8,0 a 4,4 0 1,0 -8,0');\r\n  motion-offset: 0%;\r\n\r\n  \/* Currently spec'd syntax. Should be in stable Chrome as of ~December 2016 *\/\r\n  offset-path: path('M 5 5 m -4, 0 a 4,4 0 1,0 8,0 a 4,4 0 1,0 -8,0');\r\n  offset-distance: 0%;\r\n \r\n  animation: move 3s linear infinite;\r\n}\r\n\r\n\/* Animate the element along the path from 0% to 100%  *\/\r\n@keyframes move {\r\n  100% { \r\n    motion-offset: 100%; \/* Old *\/\r\n    offset-distance: 100%; \/* New *\/\r\n  }\r\n}<\/code><\/pre>\n

In the example above, we have set the initial motion-offset<\/code> value at 0%<\/code>, though it’s worth noting that zero is the default value, even when not explicitly defined (we could have left that out).<\/p>\n

Variables<\/h3>\n

The offset-distance<\/code> property accepts the following values:<\/p>\n