123

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.

            
              <section id="top" class="layout">
  <header>
    <hgroup>
      <h1>HTML5 Bad-boy Layout</h1>
      <p class="sub-header">
        A Fuild Height and Width Solution, bad-boy style.
      </p>
    </hgroup>
    <nav>
      <ul class="main-nav">
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
      </ul>  
    </nav>
  </header>
  <section class="bad-boy">
    <article class="content">
      <h2>What is the <em>Bad-boy</em> layout?</h2>
      <p>
        The bad-boy layout is this layout. This layout is a fluid layout ready for responsive implementations. It contains equal height content and sidebar blocks. The idea behind this layout is based on using tables. I recently built a site that needed the flexibility found in this layout. I tried some <a href="#">jQuery from css-tricks.com</a>, my height got locked in and didn't expand again unless I triggered it with resize(). Then I tried <a href="#">Fuex Columns</a>, but I couldn't get it to work right with box-sizing: border-box; and padding. 
      </p>
      <blockquote>
        <p>Where did I go wrong?...</p>
      </blockquote>
      <p>
        Neither worked just right for me. I had different background colors in the sidebar and content area, and when adjusting the browser the background wouldn't flow past the bottom of the content area. That's when I hacked out this bad-boy.
      </p>
      <p>
        The major drawback to this example is browser support, that's where the "bad" comes into play. Internet Explorer 8 (ie8) requires a DOCTYPE! and ie7 is out completely. However, I generally only support ie8 and up, so this limitation doesn't affect me.
      </p>
    </article>
    <aside class="sidebar">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a nisi metus. Morbi accumsan laoreet elit id ultrices. Fusce sit amet dignissim dolor. Maecenas convallis congue purus sed mattis. Sed velit orci, blandit varius fringilla nec, suscipit pretium sapien. Integer blandit blandit porta. Fusce ut gravida orci. Nulla eleifend mi id erat accumsan aliquam. In hac habitasse platea dictumst. Nulla congue sapien in nibh mollis nec laoreet ante bibendum.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a nisi metus. Morbi accumsan laoreet elit id ultrices. Fusce sit amet dignissim dolor. Maecenas convallis congue purus sed mattis. Sed velit orci, blandit varius fringilla nec, suscipit pretium sapien. Integer blandit blandit porta. Fusce ut gravida orci. Nulla eleifend mi id erat accumsan aliquam. In hac habitasse platea dictumst. Nulla congue sapien in nibh mollis nec laoreet ante bibendum.</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a nisi metus. Morbi accumsan laoreet <a href="#">elit id ultrices</a>. Fusce sit amet dignissim dolor. Maecenas convallis congue purus sed mattis. Sed velit orci, blandit varius fringilla nec, suscipit pretium sapien. Integer blandit blandit porta. Fusce ut gravida orci. Nulla eleifend mi id erat accumsan aliquam. In hac habitasse platea dictumst. Nulla congue sapien in nibh mollis nec laoreet ante bibendum.</p>
    </aside>
  </section>
</section>
<footer class="footer">
  <aside class="mod">
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a nisi metus. Morbi accumsan laoreet elit id ultrices. Fusce sit amet dignissim dolor. Maecenas convallis congue purus sed mattis.</p>
  </aside>
</footer>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic');

@primary_gray: #666666;
@primary_light: #f0f0f0;
@pink: #e23351;
@yellow: #f2b844;
@orange: #ea764b;
@blue: #33a9e2;

* {box-sizing: border-box;}

body {
  background: #primary_light; 
  border-top:5px solid #e23351;
  font-family:'Source Sans Pro', sans-serif;
  font-size:28px;
  line-height:42px;
  font-weight:100;
  color: @primary_gray; 
  margin:0 auto;
}

a {
  color: @blue;
  text-decoration:underline;
  &:hover {
    text-decoration:none;
    color: lighten(@blue, 10%);
  }
}

.main-nav {
  margin:1.5em 0 2em;
  padding:0;
  display:table;
  width:100%;
  & > li {
    display:table-cell;
    text-align:center;
    a {
      background:lighten(@primary_gray, 45%);
      display:block;
      padding:0.75em 1em;
      text-decoration:none;
      color: #e23351;
      border-left: 1px solid #e23351;
    }
    &:first-child a {
      border:0 none;
    }
  }
}
  
.layout {
  margin:2em auto;
  width:78%;
  color: #404040; 
  & > header {
    h1 {
      font-size:3em;
      line-height:1em;
      font-weight: 700;
    }
    p.sub-header {
      font-size:1.5em;
      line-height:1.5em;
      font-style:italic;
    }
  }
}

blockquote {
  font-style:italic;
  padding:0.75em 2em;
}

.content {
  h2 {
    font-size:1.8em;
    line-height:1.8em;
  }
  p {
    padding-bottom:1em;
  }
}

.sidebar {
  p {
    padding:0 0 1em;
  }
}

.footer {
  margin:0 auto;
  width:78%;
  background:lighten(@primary_gray, 45%);
  padding:0.75em 1em;
  border-top: 3px solid @blue;
}

/* The bad layout */
.bad-boy {
  display:table-row;
  .content, .sidebar {
    display:table-cell;
    padding:0 1.5em;
  }
  .content {
    width:auto;
    border-top: 3px solid @yellow;
    border-bottom: 3px solid @yellow;
  }
  .sidebar {
    width:33.33%;
    background-color:@primary_gray;
    color:lighten(@primary_gray, 25%);
    border-top: 3px solid @orange;
    border-bottom: 3px solid @orange;
  }
}
            
          
!
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.

Console