Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <img    sizes="(max-width: 320px) 320px, 
               (max-width: 640px) 640px, 
       srcset="  320w,
  <li>The browser will look at device width,</li>
  <li>work out which media condition in the sizes list is the first one to be true,</li>
  <li>look at the slot size given to that media query,</li>
  <li>load the image referenced in the srcset list that has the same size as the slot</li>
  <li>if there isn't one, the first image that is bigger than the chosen slot size.</li>
  <li>Test this in Codepens Debug View, with Dev Tools Network tab open. Resize the viewport to 300px, then hit reload. Now scale the viewport larger to see the larger resolution images load. Scaling smaler again won't have an effect, as larger images are already loaded (<a href="">watch screenrecording</a>).</li>
  <li>⚠ For the slot width, you may provide an absolute length (px, em) or a length relative to the viewport (vw), but <strong>not percentages.</strong> </li>
  <li><a href="">MDN: Responsive images</a></li>
  <li><a href=""> Use srcset to automatically choose the right image size</a></li>


                body {
a {
  color: unset;
li {
  margin-bottom: .5em;
img {
  max-width: 100%;