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="grid">
      <div class="side">
        <div class="header"></div>
        <ul>
          <li>First item</li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li>Last item</li>
        </ul>
        <div class="footer"></div>
      </div>
      <div class="content">
        <h2>Content</h2>
      </div>
    </div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  margin: 2vh;
}

.grid {
  height: 96vh;
  display: grid;
  grid-template-columns: 300px 1fr;
  border: 2px solid rgba(89, 190, 205, 1);
  gap: 1rem;
  
/*
When you have grid tracks set with flexible `fr` units, it's size will be calculate based on grid item the content size (entire content will be fit in). So if you have large content like in this case the grid's content will overflow and stretch the entire grid above those 90vh set in height.
  
It works exactly same as if you would define it like minmax(auto, 1fr). To keep the content in the grid constrains and do not stretch out of defined size you have to define it like minmax(0, 1fr).
  
In this example if you uncomment the line below the grid will shrink to 90vh and you can scroll the items in left sidebar.
*/
grid-template-rows: 1fr;
/* 👇 UNCOMMENT */
// grid-template-rows: minmax(0, 1fr); 
}

ul {
  list-style: none;
  height: calc(100% - 6rem);
  overflow-y: auto;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(89, 190, 205, 1);
}

li {
  height: 100px;
  border-top: 1px solid rgba(89, 190, 205, 1);
  border-bottom: 1px solid rgba(89, 190, 205, 1);
}

.header {
  background-color: rgba(89, 190, 205, 0.6);
  height: 3rem;
}

.footer {
  background-color: rgba(89, 190, 205, 0.6);
  height: 3rem;
}

.content {
  padding: 1rem;
  background: repeating-linear-gradient(-45deg, rgba(50, 127, 190, 0.3), rgba(50, 127, 190, 0.3) 3px, transparent 3px, transparent 7px) rgba(89, 190, 205, 0.3);
}

              
            
!

JS

              
                
              
            
!
999px

Console