<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;
  }
}
View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js