Pen Settings

HTML

CSS

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

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

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.

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

              
                <header role="banner">
  <h1 class="fcurtain-identity">Fixed Curtains</h1>
  <nav role="navigation">
    <a href="">link 1</a>
    <a href="">link 2</a>
    <a href="">link 3</a>
  </nav>
</header>

<main role="main">
  <section class="fcurtain--cover fcurtain--callout">
    <h2>A Sassy Layout Pattern for Authors</h2>
    <p>Scroll down to learn more about this HTML template</p>
  </section>

  <section class="fcurtain">
    <header>
      <h1>Getting Started</h1>
    </header>
    <p>This template uses <abbr title="cascading stylesheets">CSS</abbr> properties for layout such as <a href="//caniuse.com/#search=flexbox"><code>flexbox</code></a> and <a href="//caniuse.com/#search=calc"><code>calc()</code></a> as well as the <code>fixed</code> value for <code>background-attachment</code>. I've also used the <a href="//caniuse.com/#search=nth-of-type"><code>nth-of-type()</code></a> selector to style each curtain's background image individually.</p>
    <p><b>Does it work on IE8?</b> You'll need to consider your own fallbacks for a minimum of IE8, but make sure to double check 9-11 as well. I didn't write IE fallbacks for you which is why you're getting this for free yo.</p>
    <p><b>What about that sweet <abbr title="responsive web design">RWD?</abbr></b> I'll let you take care of that business since it's a unique thing based on your unique needs. Once again it's free, but keep an eye our for a paid version in the future with better features like <abbr title="responsive web design">RWD</abbr>, Performance Optimizing, Additional Functionality and Support.</p>
    <p><b>What else is going on?</b> ARIA roles are baked in plus I made this template super clean for you to get started by ensuring removeable items are super easy to remove. Authors can also declare the height of the fixed panels using a Sass variable and passing either <code>fixed</code> or <code>full</code>. You're also on your own for a grid system should you choose to use one. Now all that's left to do is copy this Markup and Sass and get to work.</p>
  </section>

  <section class="fcurtain--cover fcurtain--callout">
    <h2>Go to 11</h2>
  </section>

  <section class="fcurtain">
    <header>
      <h1>Turn that volume up</h1>
    </header>
    <p>Wanna make this template really awesome? Why not add some media queries or even a fancy ass JavaScript thingy. You could also use something like the <code>picture</code> element or <code>srcset</code> to help control these massive background images for various screen dimensions. Anyways, here's some more lorem ipsum that I know you love so much.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio culpa, praesentium eius veniam odio recusandae sed deserunt fuga assumenda explicabo. Nobis omnis nulla illo enim, temporibus maxime qui repellat atque!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio culpa, praesentium eius veniam odio recusandae sed deserunt fuga assumenda explicabo. Nobis omnis nulla illo enim, temporibus maxime qui repellat atque!</p>
  </section>

  <section class="fcurtain--cover fcurtain--callout">
    <h2>Section Intro</h2>
  </section>

  <section class="fcurtain">
    <header>
      <h1>Section Title</h1>
    </header>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio culpa, praesentium eius veniam odio recusandae sed deserunt fuga assumenda explicabo. Nobis omnis nulla illo enim, temporibus maxime qui repellat atque!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio culpa, praesentium eius veniam odio recusandae sed deserunt fuga assumenda explicabo. Nobis omnis nulla illo enim, temporibus maxime qui repellat atque!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio culpa, praesentium eius veniam odio recusandae sed deserunt fuga assumenda explicabo. Nobis omnis nulla illo enim, temporibus maxime qui repellat atque!</p>
  </section>

  <footer role="contentinfo">
    <small>Fixed Curtains ©2014 all rights reserved</small>
  </footer>
</main>
              
            
!

CSS

              
                // Demo Crap
*{&:before, &:after{box-sizing: inherit;}}html{box-sizing: border-box;font-family:'Droid Serif',serif;font-size: 100%;line-height:1.5;}header[role="banner"]{padding: 20px;}footer[role="contentinfo"]{background:#253537;color:white;}h2{margin-bottom: 0;}nav a{color: #071A24;padding:0 5px;text-decoration: none;}


// Required Styles & Config
// READ FIRST:
// This demo uses normalize and autoprefixer. I strongly suggest that you find
// something to prefix junk for you otherwise you're writing it out by hand.

$fcurtain_lgscr: 640px;
$fcurtain_type: full; // accepts [full,fixed]
$fcurtain_height: null; // accepts px value if height is fixed (i.e. 340px)
$fcurtain_bg: #EFE99D;
$fcurtain_bgimg: (
  // panel position  : panel image
  1 : 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/392/mountain-peaks.jpg',
  3 : 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/392/geometric-mountains.jpg',
  5 : 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/392/mountain-gaze.jpg'
);


html,
body,
main {
  height: 100%;
}

header[role="banner"] {
  display: flex;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  z-index: 1;
}

.fc-identity {
  flex: 5;
}

nav[role="navigation"] {
  flex: 5;
  text-align: right;
}

main[role="main"] > * {
  max-width: $fcurtain_lgscr;
  padding: 1.65em calc(50% - #{$fcurtain_lgscr/2});
}

.fcurtain--cover {
  @if $fcurtain_type == full {
    min-height: 100%;
  } @elseif $fcurtain_type == fixed {
    height: $fcurtain_height;
  }
  position: relative;
  background-size: cover;
  background-attachment: fixed;
  background-positon: center center;
  background-repeat: no-repeat;
  background-color: $fcurtain_bg;
  @each $key, $value in $fcurtain_bgimg {
    &:nth-of-type(#{$key}) {
      background-image: url(#{$value});
    }
  }
}

.fcurtain--callout {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console