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="alert alert-error">
  <div class="alert-content">
    <h2 class="alert-title">
      It look like there was a problem.
    </h2>
    <div class="alert-body">
      <p>Please make sure to double check that the form below has all the correct information.</p>
    </div>
  </div>
</div>

<div class="alert alert-warning">
  <div class="alert-content">
    <h2 class="alert-title">
      We need more information before we begin.
    </h2>
    <div class="alert-body">
      <p>If you don’t submit this information by January 24 2019 there could be penalties and surcharges added.</p>
    </div>
  </div>
</div>

<div class="alert alert-success">
  <div class="alert-content">
    <h2 class="alert-title">
      Success!
    </h2>
    <div class="alert-body">
      <p>We’ve sent all your information to the agency and we’ll be in touch soon – there’s no need to worry.</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  max-width: 600px;
  align-items: center;
  margin: 40px auto;
}

.alert {
  --theme: #ccc;
  --darkTheme: #777;
  --icon: '';
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  max-width: 600px;
  border-radius: 4px;
  background: var(--theme);
  border: 1px solid var(--darkTheme);
  display: flex;
  margin-bottom: 20px;
  
  &:before {
    content: '';
    width: 80px;
    position: relative;
    z-index: 999;
    background-color: var(--darkTheme);
    background-repeat: no-repeat;
    background-position: center 15px;
    background-size: 30px;
    background-image: var(--icon);
  }
}

.alert-content {
  padding: 20px;
}

.alert-title {
  margin: 0;
  margin-bottom: 5px;
  font-size: 18px;
  padding: 0;
  color: var(--darkTheme);
}

.alert-body {
  p {
    margin: 0;
    font-size: 16px;
  }
}

.alert-success {
  --theme: #f0f9ef;
  --darkTheme: #7ebb7a;
  --icon: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/14179/success.svg);
}

.alert-error {
  --theme: #fff5f5;
  --darkTheme: #f78b8b;
  --icon: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/14179/error.svg);
}

.alert-warning {
  --theme: #fff9f0; 
  --darkTheme: #ffc848;
  --icon: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/14179/warning.svg);
}
              
            
!

JS

              
                
              
            
!
999px

Console