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

              
                <div class="warning">Warning! Your browser does not support CSS container queries. Please open this demo in Chrome Canary with the experimental #enable-container-queries flag turned on.</div>

<div class="post">
  <div class="post__wrapper">
    <div class="post__thumb">pic</div>
    <div class="post__content">
      <h1 class="post_title">Super cool title</h1>
      <time class="post_time" datetime="2021-06-18">2021.06.18</time>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Rem eveniet nemo quas quam delectus natus quae, maiores animi ut ducimus tenetur dignissimos? Rem, doloremque optio labore illo expedita sit suscipit voluptas sapiente cupiditate aspernatur sint!</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 1.6rem;
  font-family: -apple-system, BlinkMacSystemFont, segoe ui, Helvetica, Arial,
    sans-serif, apple color emoji, segoe ui emoji, segoe ui symbol;
  font-size: 1rem;
  line-height: 1.6rem;
  background: #eee;
}

.warning {
  margin-bottom: 1.6rem;
  background: #ffcdd2;
  border: 1px solid #e57373;
  padding: 1.6rem;
}

@supports (contain: inline-size) {
  .warning {
    display: none;
  }
}

.post {
  contain: layout inline-size style;
  resize: horizontal;
  overflow: auto;
  max-width: 100%;
}

.post__wrapper {
  padding: 1.6rem;
  border: 1px solid #ccc;
  background: #fff;
}

@container (min-width: 400px) {
  .post__wrapper {
    display: grid;
    grid-template-columns: 4.8rem 1fr;
    grid-gap: 1.6rem;
  }
}

.post__thumb {
  background: #ccc;
  width: 4.8rem;
  height: 4.8rem;
  float: left;
  margin-right: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #888;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 2px;
}

.post_title {
  font-size: 1rem;
  font-weight: 700;
}

.post_time {
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  display: block;
}

              
            
!

JS

              
                
              
            
!
999px

Console