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

              
                <!doctype html>
<html ⚡4email>
  <head>
    <meta charset="utf-8">
    <style amp4email-boilerplate>body{visibility:hidden}</style>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-selector" src="https://cdn.ampproject.org/v0/amp-selector-0.1.js"></script>
    <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
    <style amp-custom>
      body {
        font-family: Roboto, Arial, sans-serif;
        background: linear-gradient(-36deg, #f3c087
          , #e88b21) fixed;
      }
      h1 {
        color: #e88b21;
      }
      .container {
        border-radius: 5px;
        text-align: center;
        padding: 5px 20px 20px 20px;
        margin: 40px auto;
        width: 500px;
        max-width: 90%;
        background: white;
      }
      .amp-form-submit-success #form-content {
        display: none;
      }
      amp-selector [option] {
        margin: 10px;
        width: 40%;
        display: inline-block;
        border: 2px solid #e6e6e6;
        border-radius: 5px;
        padding: 10px;
        outline: 0;
      }
      amp-selector [option][selected] {
        border-color: #e88b21;
        outline: 0;
      }
      .updateButton {
        background: #e88b21;
        color: white;
        border: 0;
        border-radius: 5px;
        padding: 10px 20px;
        font: inherit;
        font-weight: 300;
        margin-top: 10px;
      }
    </style>
  </head>
  <body>
    <div class="container">
    <!-- ampbyexampel.com is used as a placeholder that allows for AMP submits -->
      <form action-xhr="https://ampbyexample.com/samples_templates/poll/submit" method="post">
        <div id="form-content">
          <h1>Thanks for subscribing to SparkPost Emails!</h1>
          <p>What kind of emails should we send you?</p>
          <amp-selector name="subscriptions" multiple>
            <div option="account-metrics" selected>Weekly Account Metrics</div>
            <div option="daily-reviews" selected>Daily Deliverability Report</div>
            <div option="newsletter" selected>Beta Tester Newsletter</div>
            <div option="product-updates" selected>Product Team Updates</div>
          </amp-selector>
          <input type="submit" value="Update" class="updateButton">
        </div>
        <div submit-success>
          <h1>Got it! We will update your preferences within 24 hours</h1>
        </div>
      </form>
    </div>
  </body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console