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="left-panel">
  <h1>width: 300px;</h1>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam vel expedita nihil praesentium, quos eius quo temporibus quasi quae nemo, soluta, sapiente saepe natus repellat fugiat est architecto ducimus laudantium consequuntur distinctio, quia. Blanditiis consequatur veniam, labore voluptate dolorem nesciunt, aliquid, totam quo veritatis ad soluta excepturi facere dolorum ex!
</div>
<div class="right-panel">
  <h1>width: calc( 100% - 300px );</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi odit architecto ad dolores deleniti voluptatum dolor consequatur sunt, esse tempora molestiae pariatur, possimus aperiam quae eveniet quibusdam, tempore suscipit ullam minus error. Cumque sunt ipsum nisi est quibusdam, cupiditate ut illo quod veritatis, quos error, necessitatibus harum voluptas soluta facere placeat blanditiis ea debitis corporis rerum! Magnam velit voluptate, a alias consectetur nobis facilis, quisquam totam? Aliquam laudantium nihil odit excepturi dicta vel deleniti nostrum sequi quaerat, facilis sapiente saepe quas delectus ducimus, culpa molestias impedit, dolorum possimus distinctio voluptates hic. Perspiciatis vitae quis magni architecto provident mollitia, veritatis sunt!</p>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Adipisci commodi totam illo dignissimos impedit quod, veniam mollitia consequuntur animi nemo nesciunt voluptates libero neque voluptatem optio dolorum vero. Ullam perferendis omnis eos ipsum numquam neque! Maxime rem voluptatem nihil autem est. Maiores provident quas cupiditate repellendus voluptate quia itaque impedit.</p>
</div>  
              
            
!

CSS

              
                *,
*:before,
*:after {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
html,body{
  height: 100%;
}
h1{
  font-size: 24px;
}
div{
  padding: 20px;
  color: #fff;
  height: 100%;
  font-family: arial;
  font-size: 14px;
  line-height: 24px;
  float: left;
}
.left-panel{
  width: 300px;
  background-color: #3498db;
}
.right-panel{
  width: calc( 100% - 300px ); /*Here is the calc function*/
  background-color: #2980b9;
}
              
            
!

JS

              
                
              
            
!
999px

Console