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="wrapper">
  <h1>Spacing Elements in CSS</h1>
  <p>Spacing is an integral part of any web design project as it's play a vital role in making the design elements not close to each other.</p>
  
  <h2>Types of Spacing</h2>
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/182774/spacing-1.png" alt="">
  <p>There are two types of spacing, one that is outside an element, and the other is inside it.</p>
  
  
  
  <p>As margin can be added in four different directions (top, right, bottom, left), it's important to shed light on some basic concepts before we dive in with example and use cases.</p>
  
  <h2>Use Cases</h2>
  <p>Let's take some use cases!</p>
  
  <h3>Card Component</h3>
  
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/182774/use-case-card-2.png" alt="">
</div>
              
            
!

CSS

              
                .wrapper {
  max-width: 700px;
  margin: 2rem auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

p {
  font-size: 1.25rem;
  margin-bottom: 1.15rem;
}

h1,
h2,
h3,
h4,
h5 {
  margin: min(7vh, 2.75rem) 0 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  margin-top: 0;
  font-size: 3.052em;
}

h2 {
  font-size: 2.441em;
}

h3 {
  font-size: 1.953em;
}

h4 {
  font-size: 1.563em;
}

h5 {
  font-size: 1.25em;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  border: 1px solid #ccc;
  margin-bottom: 0.5rem;
}

html {
  font-size: 12px;

  @media (min-width: 700px) {
    font-size: 16px;
  }
}

body {
  line-height: 1.65;
  font-family: "Rubik", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f8f8f8;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

              
            
!

JS

              
                
              
            
!
999px

Console