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.

  %header.header-image__image{:style => "background-image: url('https://unsplash.it/800/530/?random')"}
        %h1 Full height big mama header
        %p Some meta
      %a{:href => "blog.alienlebarge.ch"}
        my blog
      \. I wanted something with full height images. Here's the result...
    %h2 Changelog
      %dt Version 0.0.1
      %dd 2014-07-22 - Release
      %dt Version 0.0.2
      %dd 2014-07-22 - Update docs in HTML
      %dt Version 0.0.3
      %dd 2014-07-24 - extract <code>.gradient-overlay</code> class
      %dt Version 0.0.4
      %dd Force scrolling on iOS
    %h2 Things to do &amp; possible improvements
      %li Fix <code>article</code>'s height to be <code>height: 100%</code> and cause element to scroll up when arriving at the bottom of the page (<a href="https://cl.ly/image/2c381y402V38" target="_blank">gifs</a>).
      %li Responsive background images
      %li add medium fadding effect on scroll
      %li add medium blur effect on scroll
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);

// variables
$base-header-height: 100%;
$base-spacing-unit: 1em;
$base-font-family: 'Open Sans', sans-serif;

body {
  height: 100%;
  font-family: $base-font-family;

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 $base-spacing-unit;

// Header image
// Put a big image in the header
// 1. Prevent iOS to not showing the content
// 2. Vertical align the text at the bottom of the header
// 3. Backgournd properties. The image is set in the HTML for CMS purpose
// 4. Center the title
// 5. Force iOS smooth scrolling

.header-image {
  position: relative; // 2.
  height: 100%;
  overflow: auto; // 1.
  -webkit-overflow-scrolling: touch; // 5.
  @at-root .header-image__image {
    height: $base-header-height;
    background-position: center center; // 3.
    background-repeat: no-repeat; // 3.
    background-size: cover; // 3.
  @at-root .header-image__content {
    color: #fff;
    position: absolute; // 2.
    bottom: $base-spacing-unit; // 2.
    left: 0;
    width: 100%; // 4.
    @at-root .header-image__content__container{
      @extend %container; // 4.

// Gradient overlay
// Add a gradient to improve text lisibility
.gradient-overlay {
  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: block;
    width: 100%;
    height: $base-header-height;
      linear-gradient(to bottom, rgba(0,0,0,0) $base-header-height/2, rgba(0,0,0,0.5) $base-header-height);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
🕑 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 ..................