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 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

              
                <div class="module">
  <h3>Spacing the Bottom of Modules</h3>
  <p>Using pseudo elements <code>::before</code> and <code>::after</code> you can add consistent padding to an element without modifying children elements.</p>
  <p>In response to: <a href="https://css-tricks.com/spacing-the-bottom-of-modules/"><strong>CSS Tricks:</strong> Spacing the Bottom of Modules</a></p>
</div>

<div class="module">
  <p>Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum id ligula porta felis euismod semper. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec ullamcorper nulla non metus auctor fringilla.</p>
</div>

<div class="module">
  <img src="http://placehold.it/300" alt="Just a nice placeholder image" />
</div>

<div class="module">
  <p>Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum id ligula porta felis euismod semper. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec ullamcorper nulla non metus auctor fringilla.</p>
  <p>Etiam porta sem malesuada magna mollis euismod. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>
</div>
              
            
!

CSS

              
                @import "compass/css3";

// ----------------------------------------------------------
// So I heard you like to see the spacing in between elements
// ----------------------------------------------------------

:hover {
  outline: 1px solid rgba(red, 0.5);
  outline-offset: -1px;
}

// -------------------------
// Those sweet module styles
// -------------------------

.module {
  background: #eee;
  margin: 20px 0;
  padding: 0 20px;
  
  &::before,
  &::after {
    content: "";
    display: block;
    height: 1px;
  }
  
  &:before {
    margin-bottom: 19px;
  }
    
  &:after {
    margin-top: 19px;
  }
}

// -----------------------    
// A Wild Mixin Appears...
// -----------------------
    
@mixin module-padding($padding) {
  padding: 0 $padding;
  
  &::before,
  &::after {
    content: "";
    display: block;
    height: 1px;
  }
  
  &:before {
    margin-bottom: $padding - 1;
  }
    
  &:after {
    margin-top: $padding - 1;
  }
}

// -----------------------------------------    
// Just some typical everyday content styles
// -----------------------------------------

body {
  margin: 20px;
  font: normal 1em/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  vertical-align: top;
  max-width: 100%;
  height: auto;
}
  
h3 {
  margin: 20px 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ccc;
}
              
            
!

JS

              
                
              
            
!
999px

Console