cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <!--
  WELP. That's about what I'm looking at.
  Picture: https://d.pr/i/giPt/qCX2bzdj

  (Thanks for watching! Gotta run :))
  https://codepen.io/chriscoyier/full/mewZzy/

  Side by side layout will work on a large screen. Flexbox makes that super easy. The hero graphic fills the area thanks to `background-size: cover`; It's super enormous though, and probably could benefit from differnet sizes in media queries in the CSS.

  Flexbox was super helpful with helping me keep the <h1> tag as the very first thing in the source order, yet, positioning to the lower left. Autoprefixer helps a ton with flexbox.

  SCSS was helpful in letting me nest that media query.

  CSS counters was a neat little touch in the menu area. The numbers don't really mean anything. In the real magazine they are page numbers. Would be nice to somehow make sure the "/"s don't start a new line...

  The main content area is exactly below the "fold" thanks to 100% height of the main header (which we reset at the breakpoint). That area didn't need any responsive help since it just had a `max-width` (largely for line-length readability).

  
-->

<header class="site-header">

  <div class="header-content">
  
    <div class="title-area">
      
      <h1>Hamburgers</h1>
      
      <p>This is a sub-headline. Yadda yadda stuff about hamburgers. You know how subheadlines work.</p>
      
      <div class="byline">
        <span>By</span>
        Johnny Hamburgers
      </div>
      
    </div>
  
    <nav role='navigation' class="toc">
      <ul>
        <li><a href="#hamburger-juicy">Juicy Hamburgers</a></li>
        <li><a href="#hamburger-fourth">Fourth of July Hamburgers</a></li>
        <li><a href="#0">Squash 'n' Hamburgers</a></li>
        <li><a href="#0">Bacon Cheeseburgers</a></li>
        <li><a href="#hamburger-juicy">Juicy Hamburgers</a></li>
        <li><a href="#hamburger-fourth">Fourth of July Hamburgers</a></li>
        <li><a href="#0">Squash 'n' Hamburgers</a></li>
        <li><a href="#0">Bacon Cheeseburgers</a></li>
      </ul>
    </nav>  
    
  </div>
  
  <div class="hero-graphic"><!-- always, right? --></div>

</header>

<main class="main-content">

  <article id="hamburger-juicy">
  
    <h2>Juicy Hamburger</h2>
    
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    
  </article>
  
  <article id="burger-fourth">
  
    <h2>Fourth of July Hamburger</h2>
    
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    
  </article>
  
  <article id="hamburger-juicy">
  
    <h2>Juicy Hamburger</h2>
    
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    
  </article>
  
  <article id="burger-fourth">
  
    <h2>Fourth of July Hamburger</h2>
    
    <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    
  </article>

</main>
            
          
!
            
              // I picked out some matching fonts.
@import url(https://fonts.googleapis.com/css?family=Oswald|Nunito:400,700);


/* Layout */
body, html {
  height: 100%;
  background: #eee;
  overflow-x: hidden;
}

.main-content {
  max-width: 600px;
  padding: 1rem;
  margin: 5rem auto 2rem;
  > article {
    margin: 0 0 10rem 0;
  }
}


/* Header */
.site-header {
  display: flex;
  height: 100%;
  background: white;
  @media (max-width: 700px) {
    height: auto;
    display: block;
    .header-content,
    .hero-graphic {
      width: 100%;
    }
    .hero-graphic {
      height: 200px;
    }
    .title-area {
      order: 1;
    }
    .toc {
      order: 2;
      background: #eee;
      margin: 1rem -2rem 0;
      padding: 1rem 2rem;
    }
  }
}
.header-content {
  width: 50%;
}
.hero-graphic {
  width: 50%;
  // this should default to a small graphic (or nothing)
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/burgers.jpg);
  background-size: cover;
  @media (min-width: 900px) {
    // use a HUGE one!
  }
  @media (min-width: 600px) {
    // use a MEDIUM one!
    // you get it.
  }
}
.header-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}
.title-area {
  order: 2;
  > p {
    color: red;
  }
}
.byline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  > span {
    color: #999;
  }
}

/* Nav */
.toc {
  > ul {
    list-style: none;
    padding: 0;
    line-height: 1.6;
    > li {
      display: inline-block;
      counter-increment: nav;
      > a {
        text-decoration: none;
        color: #333;
        text-transform: uppercase;
        font-size: 0.9rem;
        &::before {
          content: "/";
          margin: 0 0.5rem;
          color: red;
        }
        &::after {
          content: counter(nav);
          font-weight: bold;
          margin: 0 0.5rem;
        }
        &:hover,
        &:focus {
          color: red;
        }
      }
      &:first-child {
        a::before {
          display: none;
        }
      }
    }
  }
}


/* Type */
body {
  font-family: 'Nunito', sans-serif;
}
h1, h2 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 3.2rem;
  border-bottom: 4px solid black;
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 2rem;
  border-width: 3px;
  color: #555;
}
            
          
!
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