CodeLab
Tutorials For Everyone
Run
Learn CSS
<!DOCTYPE html> <html> <head> <style> #container { width: 400px; height: 180px; margin: 20px; position: relative; margin: auto; background-color: #f8f9fa; box-shadow: 0 0 10px 0 #aaa; } svg { position: absolute; height: 100%; width: 100%; left: 0; top: 0; } img { position: absolute; z-index: 1; width: 70px; offset-path: path('M 50 80 C 150 -20 250 180 350 80'); animation: moveFish 5s infinite; } @keyframes moveFish { 0% { offset-distance: 0%; opacity: 1; } 80% { opacity: 0.9;} 100% { offset-distance: 100%; opacity: 0; } } </style> </head> <body> <h1>Animatable 'offset-distance' Property</h1> <hr> <p>Fish moves along the path using the offset-distance property, which is animatable.</p> <div id="container"> <img id="fish1" src="images/fish.png" alt="fish"> <svg fill="none" stroke="gray" stroke-width="2" stroke-dasharray="5,5"> <path d="M 50 80 C 150 -20 250 180 350 80" /> </svg> </div> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console