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

              
                <main lang="en">
  <h1>CodePen Home
    WebAIM Million 2021 - What Devs need to know (Code examples)</h1>
  <h2>Low contrast text</h2>
  <button id="badColour">This contrast sucks!</button>
  <hr>
  <h2>Missing alternative text for images</h2>
  <img alt="A building in Kolkata" src="https://cdn-images-1.medium.com/max/800/1*MuiR77p9gmntMbdYUCNcWQ.jpeg">
  <hr>
  <h2>Missing form input labels</h2>
  <h3>Preferred</h3>
  <h4>Assigned label:</h4>
  <label for="fname">First name:</label><input type="text" id="fname">
  <h4>Nested label:</h4>
  <label>First Name:<input type="text"></label>
  <h4>Aria-labelledby:</h4>
  <span id="fname">First Name:</span><input type="text" aria-labelledby="fname">
  <h3>Special cases:</h3>
  <h4>Aria-label (replaces label for screen readers and is not visible):</h4>
  <input type="button" value="X" aria-label="close window">
  <hr>
  <h2>Empty Links</h2>
  <a href="http://www.example.com"><i class="fab fa-twitter fa-9x"></i> <span class="sr-only">The A11y Coder Twitter page</span></a>
  <hr>
  <h2>Missing document language</h2>
  <p class="italic">Inspect the &#60;main&#62; element of this page to see the lang attribute in action</p>
  <hr>
  <h2>Empty Buttons</h2>
  <p>Note: this button does nothing</p>
  <button><img src="https://cdn-images-1.medium.com/fit/c/32/32/1*ViAdGpX13GVYtRFTYUaivQ.png" alt="the a11y coder"></button>
</main>
              
            
!

CSS

              
                #badColour {
  color: #ff0000;
  background-color: #0000E0;
  font-size: 16px;
  font-weight: bold;
}
              
            
!

JS

              
                
              
            
!
999px

Console