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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/127607/flow-chart.svg" role="presentation" />
<h1>I need container queries!</h1>
<dl>
  <dt>Have you considered another design aspect that doesn't require queries?</dt>
    <dd><strong>No:</strong> Try this first, there may be a manner in which you can solve the same problem without needing any container query approach.</dd>
    <dd><strong>Yes:</strong> Move onto the next item</dd>
  <dt>Is the container you're querying always a specific percentage to the viewport?</dt>
    <dd><strong>Yes:</strong> Then use a media query</dd>
    <dd><strong>No:</strong> Move on to the next item</dd>
  <dt>Does the query depend on its child's size?</dt>
    <dd><strong>No:</strong> Move on to the next item</dd>
    <dd><strong>Yes:</strong> Move to <a href="#will-your-query" title="Navigate to the next item">this item</a></dd>
  <dt>Does your container need access to the parent document (eg: access to CSS custom properties within that document)?</dt>
    <dd><strong>No:</strong> Use an iframe</dd>
    <dd><strong>Yes:</strong> Move on to the next item</dd>
  <dt id="will-your-query">Will your query change layout</dt>
    <dd><strong>No:</strong> Move to the <a href="#overflow" title="Move to the next item">this item</a></dd>
    <dd><strong>Yes:</strong> Try to use modern layout such as Grid or Flexbox</dd>
  <dt>Did the modern layout work?</dt>
    <dd><strong>No:</strong> Move to the next item</dd>
    <dd><strong>Yes:</strong> Sweet!</dd>
  <dt id="overflow">Is the scenario primarily impacted by content overflowing?</dt>
    <dd><strong>Yes:</strong> Then use the IntersectionObserver technique</dd>
    <dd><strong>No:</strong> Then use resizeObserver</dd>
</dl>
    
              
            
!

CSS

              
                body {
  background: #333;
  display: grid;
  color: white;
  font-family: "Segoe UI Light", Arial, Verdana, sans-serif;
  justify-items: center;
}

a:link {
  color: lime;
}

              
            
!

JS

              
                
              
            
!
999px

Console