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="flex-master">

  <header class="page-header">
    This is a header
  </header>


  <div class="page-content">
    <nav class="sidebar-left">
      <h3>Sidebar</h3>
      <ul>
        <li>Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
        <li>Item 4</li>
        <li>Item 5</li>
        <li>Item 6</li>
        <li>Item 7</li>
        <li>Item 8</li>
        <li>Item 9</li>
        <li>Item 10</li>
        <li>Item 11</li>
        <li>Item 12</li>
        <li>Item 13</li>
        <li>Item 14</li>
        <li>Item 15</li>
        <li>Item 16</li>
        <li>Item 17</li>
        <li>Item 19</li>
      </ul>
    </nav>

    <div class="splitter">
    </div>

    <div class="content-container">
      <article class="main-content">
        This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr /> This is my main content!
        <hr />
      </article>
      
      <aside class="page-ads">
        <div class="advert">
          Display Ad
        </div>

        <div class="advert">
          Ad
        </div>

        <div class="advert">
          Ad
        </div>

        <div class="advert">
          Ad
        </div>
      </aside>
    </div>
  </div>

  <footer>
    <small>&copy West Wind Technologies, 2016</small>
  </footer>

</div>
              
            
!

CSS

              
                 html,
 body {
   height: 100%;
   padding: 0;
   margin: 0;
   font-family: Arial, Helvetica, sans-serif;
 }
 
 .flex-master {
   display: flex;
   flex-direction: column;
   flex-wrap: nowrap;   
   height: 100%;
   overflow-x: auto;
   overflow-y: hidden;
 }
 
 .page-header {
   /* fixed size */
   flex: none;
   
   padding: 15px;
   font-size: 3em;
   font-weight: bold;
   background: #535353;
   color: white;
 }
 
 .page-content { 
   /* resize in container */
   flex: 1; 
   
   /* IMPORTANT for FireFox */
   overflow-y: auto;
   overflow-x: hidden;
   
   /* new flex container for content */
   display: flex;
   flex-direction: row;
 }
 
 .sidebar-left {   
   flex: none;
   background: #838383;
   padding: 20px;
   width: 250px;
   min-width: 150px;
   overflow: auto;
   color: white;
   white-space: nowrap;   
 }
 
 .splitter {     
   flex: none;
   width: 17px;
   cursor: col-resize;
   background: #535353;
   background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
 }
 
 .content-container {
   flex: 1 1 auto;
   background: #eee;
   padding: 20px;
   width: 100%;
   min-width: 400px;
   overflow-y: auto;
   overflow-x: hidden;
   display: flex;
   /* new flex for content/ads*/
   flex-direction: row;
 }
 
 .main-content {
   flex: 1 1 auto;
   width: 100%;
   padding: 10px;
   min-width: 300px;
 }
 
 .page-ads {
   flex: none;
   border-left: 1px solid silver;
   margin-left: 10px;
   padding-left: 10px;
   width: 180px;
   overflow: hidden;
   
   display: flex;
   /* new flex for each ad*/
   flex-direction: column;
 }
 
 .advert {
   flex: none;
   align-self: center;
   padding: 5px;
   margin: 15px;
   width: 150px;
   height: 150px;
   background: lightblue;
   color: green;
   overflow: hidden;
   /* center ad text */
   display: flex;
   justify-content: center;
   align-items: center;
 }
 
 footer {
   flex: none;
   background: #535353;
   color: white;
   padding: 10px;
 }
@media(max-width: 900px) {
  .page-ads { display: none; }
}
              
            
!

JS

              
                // jquery-resizable
//http://weblog.west-wind.com/posts/2015/Dec/21/A-small-jQuery-Resizable-Plugin
$(".sidebar-left").resizable({
   handleSelector: ".splitter",
   resizeHeight: false
 });

              
            
!
999px

Console