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

              
                <!-- This wrapper here is important -->
<section class="article-wrap">
  <article class="article-content">
    <h1>2 columns, both 100% height</h1>
    <p>
      No images, no extra elements.
    </p>
    <p>
      The content area is fluid width, while the sidebar staying fixed width. No hacks, no bullsit just normal CSS.
    </p>
    <p>
      The pseudo elements that make the columns 100% height are discolored a bit to illustrate how it works.
    </p>
    <p>
      If you're not reading my blog article about this, <a href="http://clubmate.fi/100-percent-height-columns-fixed-width-sidebar-pure-css-solutions-to-commons-fluid-layout-problems">you may want to.</a>
    </p>
  </article>
</section>
<aside class="sidebar">
  <h2>Sidebar</h2>
  <ul>
    <li>Lorem.</li>
    <li>Natus.</li>
    <li>Voluptatibus.</li>
    <li>Esse!</li>
    <li>Laudantium.</li>
  </ul>
</aside>
              
            
!

CSS

              
                @import "compass/css3";

// Variabless
$sidebarWidth: 220px;
$color-green: Aquamarine;
$globalPadding: 20px;

// The important stuff starts here
.article-wrap {
  margin-right: $sidebarWidth;
}
.article-content,
.sidebar {
  box-sizing: border-box;
  background: $color-green;
  float: left;
  padding: $globalPadding;
}
.sidebar:after,
.article-content:after {
  background: shade($color-green, 3%);
  content: ""; // Needed
  display: block; // Needed
  height: 5000px; // Very large value
  position: fixed; top: 0; // Needed
}
.article-content {
  border-color: white;
  border-style: solid;
  border-width: $globalPadding 0 0 $globalPadding;
  width: 100%;
  &:after {
    left: $globalPadding; // Positioning
    width: 100%;
    z-index: -1;
  }
}
.sidebar,
.sidebar:after {
  // These borders are rather important
  // Put them in blue or red to see how it works
  border-color: white;
  border-style: solid;
  border-width: $globalPadding $globalPadding 0 $globalPadding;
  box-sizing: border-box;
  width: $sidebarWidth;
  z-index: -1;
}
.sidebar:after {
  right: 0;
}



// Just irrelevant styling
h1,
h2,
p {
  margin: 0 0 15px 0;
}
h2 {
  font-size: 20px;
}
ul {
  padding-left: 20px;
}
              
            
!

JS

              
                
              
            
!
999px

Console