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

              
                <div class="container-sm">
  <div class="demo-row">
    <div class="box gingham">

    </div>
  </div>
  <div class="demo-row">
    <div class="box guides">

    </div>
  </div>
  <div class="demo-row">
    <div class="box blueprint">

    </div>
  </div>
  <div class="demo-row">
    <div class="box polka-dot">

    </div>
  </div>
  <div class="demo-row">
    <div class="box checkerboard">

    </div>
  </div>
  <div class="demo-row">
    <div class="box checkerboard-svg">

    </div>
  </div>
  <div class="demo-row">
    <div class="box cicada-stripes"></div>
  </div>
  
  <div class="demo-row">
    <div class="box gradient-border gradient-border-1">
      Linear-gradient background-image
    </div>
  </div>
  
  <div class="demo-row">
    <div class="box gradient-border gradient-border-2">
      Linear-gradient background-image
    </div>
  </div>
  
  <div class="demo-row">
    <div class="box gradient-border-image">
      Linear-gradient border-image
    </div>
  </div>
  
  <div class="demo-row">
    <div class="box continuous-borders">
      Hello, lucy!
    </div>
  </div>

  <div class="demo-row">
    <div class="box continuous-borders marching">
      Hello, lucy!
    </div>
  </div>
  <div class="demo-row">
    <div class="box marching-ants">
      Hello, lucy!
    </div>
  </div>
  <div class="demo-row">
    <div class="box footnote">
      <sup>1</sup>This is a footnote.
    </div>
  </div>
</div>
              
            
!

CSS

              
                .box {
  height: 150px;
  padding: 10px;
}

.gingham {
  @bg: rgba(200, 0, 0, .5);
  @width: 15px;
  background-image: linear-gradient(@bg 50%, transparent 0),
    linear-gradient(90deg, @bg 50%, transparent 0);
  background-size: @width*2 @width*2;
}

.guides {
  @color: white;
  @width: 30px;
  background-color: #58a;
  background-image: linear-gradient(@color 1px, transparent 0),
    linear-gradient(90deg, @color 1px, transparent 0);
  background-size: @width @width;
}

.blueprint {
  @color: hsla(0, 0%, 100%, .3);
  @accent-color: white;
  @width: 10px;
  background-color: #58a;
  background-image: linear-gradient(@color 1px, transparent 0),
    linear-gradient(90deg, @color 1px, transparent 0),
    linear-gradient(@accent-color 2px, transparent 0),
    linear-gradient(90deg, @accent-color 2px, transparent 0);
  background-size: @width @width, @width @width,
    @width*5 @width*5, @width*5 @width*5;
}

.polka-dot {
  @color: white;
  @size: 30px;
  background-color: pink;
  background-image: radial-gradient(@color 20%, transparent 0),
    radial-gradient(@color 20%, transparent 0);
  background-size: @size @size;
  background-position: 0 0, @size/2 @size/2;
}

.checkerboard {
  @size: 30px;
  @bg: rgba(0, 0, 0, .25);
  background-color: #eee;
  background-image: linear-gradient(45deg, @bg 25%, transparent 0, transparent 75%, @bg 0),
    linear-gradient(45deg, @bg 25%, transparent 0, transparent 75%, @bg 0);
  background-position: 0 0, @size/2 @size/2;
  // http://play.csssecrets.io/test-conic-gradient
  // background-image: repeating-conic-gradient(#bbb 0, #bbb 25%, #eee 0, #eee 50%);
  background-size: @size @size;
}
.checkerboard-svg {
  background: #eee url('data:image/svg+xml,\
    <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" fill-opacity=".25" >\
    <rect x="50" width="50" height="50" />\
    <rect y="50" width="50" height="50" />\
    </svg>');
  background-size: 30px 30px;
}

.cicada-stripes {
  background-color: hsl(20, 40%, 90%);
  background-image: linear-gradient(90deg, #fb3 11px, transparent 0),
    linear-gradient(90deg, #ab4 23px, transparent 0),
    linear-gradient(90deg, #655 41px, transparent 0);
  background-size: 41px 100%, 61px 100%, 83px 100%;
}

.gradient-border {
  position: relative;
  background-color: #fff;
  background-clip: content-box;
  &::before {
    content: ''; position: absolute; z-index: -1;
    top: 0; right: 0; bottom: 0; left: 0;
  }
}
.gradient-border-1::before {
  background-image: linear-gradient(135deg, hsl(9, 100%, 64%), hsl(40, 100%, 64%));
}
.gradient-border-2::before {
  background-image: linear-gradient(hsl(9, 100%, 64%), hsl(51, 100%, 50%));
}
.gradient-border-image {
  border: 10px solid;
  border-image: linear-gradient(45deg, hsl(120, 100%, 50%), hsl(180, 100%, 50%)) 1 1 stretch;
}

.continuous-borders {
  border: 1em solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(-45deg,
      #ff5d6c 0,
      #ff5d6c 12.5%,
      transparent 0,
      transparent 25%,
      #1b85c1 0,
      #1b85c1 37.5%,
      transparent 0,
      transparent 50%) 0 ~"/" 6em 6em;
}

@keyframes ants {
  to { background-position: 100%; }
}
.marching {
  animation: ants 12s linear infinite;
}

.marching-ants {
  border: 1px solid transparent;
  background: linear-gradient(white, white) padding-box,
    repeating-linear-gradient(-45deg, black 0, black 25%, white 0, white 50%
) 0 ~"/" .6em .6em;
  .marching;
}

.footnote {
  border-top: .2em solid transparent;
  border-image: 100% 0 0 linear-gradient(90deg, currentColor 4em, transparent 0);
}
/**
 * More patterns
 * http://lea.verou.me/css3patterns/
 * http://philbit.com/svgpatterns/
 * https://bennettfeely.com/gradients/
 */
              
            
!

JS

              
                
              
            
!
999px

Console