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

              
                <div class="grid">
  <div class="diagonal-stripes">
    <span>Diagonal Stripes</span>
  </div>
  <div class="subtle-stripes">
    <span>Subtle Stripes</span>
  </div>
  <div class="picnic-table">
    <span>Picnic Table</span>
  </div>
  <div class="gridlines">
    <span>Gridlines</span>
  </div>
  <div class="blueprint">
    <span>Blueprint</span>
  </div>
  <div class="polka-dots">
    <span>Polka Dots</span>
  </div>
  <div class="checkerboard">
    <span>Checkerboard</span>
  </div>
  <div class="houndstooth">
    <span>Houndstooth</span>
  </div>
</div>

              
            
!

CSS

              
                body {
  background: #F0F0F0;
}

.grid > div {
  float: left;
  width: 250px; height: 200px;
  border: 2px solid #444;
  margin: 20px;
  padding: 20px 10px;
  font: 400 1.5em sans-serif;
  color: #444;
}

.grid > div > span {
  background: hsla(0, 0%, 100%, 0.65);
  padding: 5px 10px;
}

.diagonal-stripes {
  background: #5aa;
  background-image: repeating-linear-gradient(60deg,
                      #5aa,
                      #5aa 15px,
                      #af3 0,
                      #af3 30px);
}

.subtle-stripes {
  background: #259;
  background-image: repeating-linear-gradient(-45deg,
                      transparent,
                      transparent 25px,
                      hsla(0, 0%, 100%, 0.2) 0,
                      hsla(0, 0%, 100%, 0.2) 50px);
}

.picnic-table {
  background: white;
  background-image: linear-gradient(90deg,
                      rgba(255, 0, 0, 0.4) 50%,
                      transparent 0),
                    linear-gradient(0deg,
                      rgba(255, 0, 0, 0.4) 50%,
                      transparent 0);
  background-size: 25px 25px;
}

.gridlines {
  background: #58a;
  background-image: linear-gradient(white 1px, transparent 0),
                    linear-gradient(90deg, white 1px, transparent 0);
  background-size: 25px 25px;
}

.blueprint {
  background: #58a;
  background-image: linear-gradient(hsla(0, 0%, 100%, 0.3) 1px, transparent 0),
                    linear-gradient(90deg, hsla(0, 0%, 100%, 0.3) 1px, transparent 0),
                    linear-gradient(white 1px, transparent 0),
                    linear-gradient(90deg, white 1px, transparent 0);
  background-size: 10px 10px, 10px 10px,
                   50px 50px, 50px 50px;
}

@mixin polka($bg_size, $dot_size, $base_color, $color_1, $color_2) {
  background: $base_color;
  background-image: radial-gradient($color_1 $dot_size, transparent 0),
                    radial-gradient($color_2 $dot_size, transparent 0);
  background-size: $bg_size $bg_size;
  background-position: 0 0, $bg_size/2 $bg_size/2;
}

.polka-dots {
  @include polka(60px, 10px, #428, #8c8, #cc8);
}

@mixin checkerboard($size, $color) {
  background-image: linear-gradient(45deg,
                      $color 25%,
                      transparent 25%,
                      transparent 75%,
                      $color 75%),
                    linear-gradient(45deg,
                      $color 25%,
                      transparent 25%,
                      transparent 75%,
                      $color 75%);
  background-position: 0 0, $size/2 $size/2;
  background-size: $size $size;
}

.checkerboard {
  background: #999;
  @include checkerboard(40px, #ccc);
}

@mixin houndstooth($size, $bg, $color) {
  background: linear-gradient(45deg,
                $bg 25%,
                transparent 0,
                transparent 75%,
                $color 0),
              linear-gradient(45deg,
                $color 25%,
                transparent 0,
                transparent 75%,
                $bg 0),
              linear-gradient(-45deg,
                $color 17%,
                $bg 0,
                $bg 25%,
                $color 0,
                $color 36%,
                $bg 0,
                $bg 64%,
                $color 0,
                $color 75%,
                $bg 0,
                $bg 83%,
                $color 0);
  background-position: 0 0, $size/2 $size/2;
  background-size: $size $size;
}

.houndstooth {
  @include houndstooth(58px, lightgreen, purple);
}

              
            
!

JS

              
                
              
            
!
999px

Console