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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!-- Basic Example -->
<a href="https://www.kickstarter.com/projects/1704706557/high-performance-django" class="hpd hpd-basic">
  
  <h4 class="hpd-title">High Performance Django</h4>
  <p class="hpd-desc">Learn to build and deploy fast, scalable Django sites with this e-book by Lincoln Loop!</p>
  
  <span href="#" class="hpd-btn">Back on <span class="hpd-kickstarter">Kickstarter</span></span>
</a>

<!-- Wide Button -->
<a href="https://www.kickstarter.com/projects/1704706557/high-performance-django" class="hpd hpd-wide">
  <div class="hpd-body">
    <h4 class="hpd-title">High Performance Django</h4>
    <p class="hpd-desc">Learn to build and deploy fast, scalable Django sites with this e-book by Lincoln Loop!</p>
  </div>
  <span href="#" class="hpd-btn">Back on <span class="hpd-kickstarter">Kickstarter</span> &#8594;</span>
</a>

<!-- Small Button, Ad Slot -->
<a href="https://www.kickstarter.com/projects/1704706557/high-performance-django" class="hpd hpd-small partner">
  <div class="hpd-body">
    <h4 class="hpd-title">High Performance Django</h4>
    <p class="hpd-desc">The ebook on how to build and deploy fast, scalable Django sites!</p>
  </div>
  <span href="#" class="hpd-btn">View <span class="hpd-kickstarter">Kickstarter</span> &#8594;</span>
</a>
              
            
!

CSS

              
                // Vars
$bg-image: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/18946/engine-flipped_3.jpg';
$bg-color: #3cadce;
$alt-color: #255571;

$fonts: 'Helvetica Neue', Helvetica, sans-serif;
$font-color: white;

@mixin hpd-basic {
  max-width: 540px;
  background-repeat: no-repeat;
  background-position: right;
  
}

@mixin hpd-basic-big {
  text-align: left;
  padding-right: 150px;
}

// Setup
body {
  padding: 50px;
  background: whitesmoke;
}

.hpd {
  margin: 0 auto 20px;
}

/*
 * Common
 */
.hpd {
  display: block;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 2px;
  background: $bg-color;
  background-image: url($bg-image);
  
  font-family: $fonts;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  color: white;
}

.hpd .hpd-title {
  margin: 0;
  font-size: 21px;
  font-style: italic;
  text-transform: uppercase;
}

.hpd .hpd-desc {
  margin: 10px 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
}

.hpd-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 2px;
  background: $alt-color;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: $font-color;
  
  transition: background .5s ease;
  
  .hpd:hover & {
    background: #2bde73; // Kickstarter green
  }
}

/*
 * Basic Ad
 */

.hpd-basic {
  @include hpd-basic;
}

@media (min-width: 600px) {
  .hpd-basic {
    @include hpd-basic-big;
  }
  
  .hpd-basic hpd-btn {
    background: transparent;
  }
}

/*
 * Wide Button
 */
.hpd-wide {
  @include hpd-basic;
  padding: 0;
  
  .hpd-body {
    padding: 14px;
  }
  
  .hpd-desc {
    margin-bottom: 0;
  }
  
  .hpd-btn {
    display: block;
    padding: 20px 14px;
  }
}

@media (min-width: 600px) {
  .hpd-wide {
    @include hpd-basic-big;
    padding: 0;
    
    .hpd-body {
      padding: 14px 150px 14px 14px;
    }
    
    .hpd-btn {
      padding: 10px 14px;
    }
  }
}

/*
 * Small, not responsive
 * Could be the smallest size but *too* small?
 */
.hpd-small {
  max-width: 180px;
  padding: 0;
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/18946/hpd-faded-wing_1.jpg'); // A little more faded
  
  .hpd-body {
    padding: 14px;
  }
  
  .hpd-title {
    font-size: 20px;
  }
  
  .hpd-btn {
    display: block;
    padding: 10px 0;
    border-radius: 0 0 2px 2px;
    font-size: 13px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console