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

Save Automatically?

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

              
                <body>
  <p>gradation&nbsp;rotate</p>
  <div class="container">
    <div class="box">
      <div class="grade rote pink"></div>
    </div>
    <div class="box">
      <div class="grade rote blue"></div>
    </div>
    <div class="box">
      <div class="grade rote rainbow"></div>
    </div>
  </div>
  <p>gradation&nbsp;transform</p>
  <div class="container">
    <div class="box">
      <div class="grade pos pink"></div>
    </div>
    <div class="box">
      <div class="grade pos blue"></div>
    </div>
    <div class="box">
      <div class="grade pos rainbow"></div>
    </div>
  </div>
  <p>gradation&nbsp;fixed</p>
  <div class="container">
    <div class="box">
      <div class="grade pink"></div>
    </div>
    <div class="box">
      <div class="grade blue"></div>
    </div>
    <div class="box">
      <div class="grade rainbow"></div>
    </div>
  </div>
</body>
              
            
!

CSS

              
                p {
  margin: 5px 0;
  text-align: center;
}

.container {
  margin: 0 auto;
  width: 250px;
  height: 70px;
  display: flex;
  justify-content: space-around;
  .box {
    width: 50px;
    height: 50px;
    overflow: hidden;
    position: relative;
    .grade {
      position: absolute;
      width: 100px;
      height: 100px;
    }
    .rote {
      top: -25px;
      left: -25px;
      animation: bgrote 10s linear infinite;
    }
    @keyframes bgrote {
      0% { transform: rotateZ(0deg);}
      50% { transform: rotateZ(180deg); }
      100% { transform: rotateZ(360deg); }
    }
    .pos {
      top: 0;
      left: 0;
      animation: bgpos 10s linear infinite;
    }
    @keyframes bgpos {
      0% { transform: translate(0, 0); }
      25% { transform: translate(-50px, 0); }
      50% { transform: translate(-50px, -50px); }
      75% { transform: translate(0, -50px); }
      100% { transform: translate(0, 0); }
    }
    .pink {
      background-image: -webkit-linear-gradient(bottom, #e8198b 0%, #c7eafd 100%);
      background-image: -moz-linear-gradient(bottom, #e8198b 0%, #c7eafd 100%);
      background-image: -o-linear-gradient(bottom, #e8198b 0%, #c7eafd 100%);
      background-image: linear-gradient(to top, #e8198b 0%, #c7eafd 100%);
    }
    .blue {
      background-image: -webkit-linear-gradient(bottom, #0c3483 0%, #a2b6df 100%, #6b8cce 100%, #a2b6df 100%);
      background-image: -moz-linear-gradient(bottom, #0c3483 0%, #a2b6df 100%, #6b8cce 100%, #a2b6df 100%);
      background-image: -o-linear-gradient(bottom, #0c3483 0%, #a2b6df 100%, #6b8cce 100%, #a2b6df 100%);
      background-image: linear-gradient(to top, #0c3483 0%, #a2b6df 100%, #6b8cce 100%, #a2b6df 100%);
    }
    .rainbow {
      background-image: -webkit-linear-gradient(bottom, #fcc5e4 0%, #fda34b 15%, #ff7882 35%, #c8699e 52%, #7046aa 71%, #0c1db8 87%, #020f75 100%);
      background-image: -moz-linear-gradient(bottom, #fcc5e4 0%, #fda34b 15%, #ff7882 35%, #c8699e 52%, #7046aa 71%, #0c1db8 87%, #020f75 100%);
      background-image: -o-linear-gradient(bottom, #fcc5e4 0%, #fda34b 15%, #ff7882 35%, #c8699e 52%, #7046aa 71%, #0c1db8 87%, #020f75 100%);
      background-image: linear-gradient(to top, #fcc5e4 0%, #fda34b 15%, #ff7882 35%, #c8699e 52%, #7046aa 71%, #0c1db8 87%, #020f75 100%);
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console