Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                     <section class="svg-bg">
        <div class="svg-animate2">
          <img src="https://i.imgur.com/mVf4QG8.png" class="sportscar" />
          <img src="https://i.imgur.com/H9IBf3r.png" class="motorbike" />
        </div>
      </section>
              
            
!

CSS

              
                /* 
Assigning a background image to the div then change position to bottom left and give absolute to sportcar and bike and place relative to the positon intended. then only change the position of from botto left to bottom right. only the background image is moving  

svg can also be used where you can animate specific object 
*/


/* SVG Animation 2 */
html{
  font-size: 62.5%;
}
.svg-animate2 {
  height: 100vh;
  background: url('https://i.imgur.com/OmH1O4d.jpg');
  background-position: bottom left;
  animation: driving 10s linear infinite;
  position: relative;
}

.sportscar {
  position: absolute;
  left: 20rem;
  bottom: -5rem;
  width: 20rem;
}

.motorbike {
  position: absolute;
  left: 70rem;
  bottom: 5.5rem;
  width: 15rem;
}

@keyframes driving {
  from {
    background-position: bottom left;
  }

  to {
    background-position: bottom right;
  }
}

/* Rain effect */
.rain {
  background: url(./img/rain.png);
  animation: rain 5s linear infinite;
}
@keyframes rain {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 20% 100%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console