css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

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

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console