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="container">
  <p class="explainer">The first paragraph is normal size. The second paragraph is set to <code>max-size</code>. The second paragraph will extend on a single line as wide as necessary to display the full content.</p>

  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum ad sed possimus quidem, nobis debitis quam iusto iste facilis soluta eveniet aliquam repudiandae unde vel expedita optio sunt officia sapiente.</p>

  <p class="wide">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Veritatis doloribus ullam cupiditate beatae vitae. Distinctio porro nisi, aliquam esse repudiandae dolorem ducimus impedit incidunt sed, fugiat quos earum laboriosam reprehenderit.</p>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wdth,wght@0,75..100,300..800;1,75..100,300..800&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

* {
  border-sizing: border-box;
}

/*  
  <weight>: Use a value from 300 to 800
  <width>: Use a value from 75 to 100
*/
body {
  font-family: "Open Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 400;
}

.container {
  inline-size: 600px;
  margin: 5em auto;
}

.explainer {
  font-weight: 700;
  font-style: normal;
  font-variation-settings: "wdth" 700;
}

p {
  inline-size: 80ch;
}

.wide {
  inline-size: max-content;
}

              
            
!

JS

              
                
              
            
!
999px

Console