Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <section id="message">
<h1>Rainbow<br/>Goodness</h1>
<p>So this is currently set to color cycle every 175 seconds, which is the same as 60 seconds per color divided by two, or 30 seconds per color, assuming roygbiv, even though I only programmed Red, Green, and Blue. The timing itself should actually make it so that each color gets its time, as no color should be a rest, anyhow. Arguably I should have done more to get the full rainbow. We hardly touched the luminosity spectrum, although I think some of that does make it in.</p>
<p>The font color looping is based on a Cyan-Magenta-Yellow loop, as the opposite of RGB.</p></section>
              
            
!

CSS

              
                    body {
      animation: colorchange 175s linear 1s infinite; /* animation-name followed by duration in seconds*/
         /* you could also use milliseconds (ms) or something like 2.5s */
      -webkit-animation: colorchange 175s linear 0s infinite alternate; /* Chrome and Safari */
    }

    @keyframes colorchange
    {
      0%   {background: red; color: cyan;}
      33%  {background: green; color: magenta;}
      66%  {background: blue; color: yellow;}
      100% {background: red; color: cyan;}
   }

    @-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */
    {
      0%   {background: red; color: cyan;}
      33%  {background: green; color: magenta;}
      66%  {background: blue; color: yellow;}
      100% {background: red; color: cyan;}
   }
section {
  width: 33vw;
  margin: 0 auto;
}
#message {
  text-align: center;
  color: inherit;
  opacity: 75%;
  mix-blend-mode: difference;
  font-family: Cooper Black, Helvetica, Arial;
}
h1 {
  font-size: 4.69em;
}
p {
  font-size: 1.6em;
  font-family: Helvetica Neue, Helvetica, Arial;
}
              
            
!

JS

              
                
              
            
!
999px

Console