Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

              
                <div class="grid">
  <section class="desktop-four tablet-six phone-twelve sky-blue">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </section>

  <section class="desktop-four tablet-six phone-twelve orange">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </section>

  <section class="desktop-four tablet-twelve phone-twelve slate-grey">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </section>
</div>

<h2> Centered Grid </h2>
<div class="grid centered">
  <section class="desktop-three tablet-nine phone-twelve pink">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </section>

  <section class="desktop-six tablet-three phone-twelve orange">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </section>
</div>

<h2> Reversed Grid </h2>
<div class="grid centered reverse">
  <div class="desktop-six tablet-six dark-blue">
    <div class="container">
      <div class="skeleton">
      </div>
      <p style="font-size: 40px;">1</p>
      <div class="skeleton"></div>
    </div>
  </div>
  <div class="desktop-six tablet-six jungle-green">
    <div class="container">
      <div class="skeleton"></div>
      <p style="font-size: 40px;">2</p>
      <div class="skeleton"></div>
    </div>
  </div>
</div>

<h2> Grid with no Gutters </h2>
<div class="grid no-gutters">
  <div class="desktop-six tablet-six dark-blue">
    <div class="container">
      <div class="skeleton">
      </div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </div>
  <div class="desktop-six tablet-six jungle-green">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </div>
</div>

<h2> Grid with relaxed Gutters </h2>
<div class="grid relaxed-gutters">
  <div class="desktop-six tablet-six orange">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </div>
  <div class="desktop-six tablet-six slate-grey">
    <div class="container">
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
      <div class="skeleton"></div>
    </div>
  </div>
</div>


<h2> Vertically Aligned Grid </h2>
<div class="vertical-container sky-blue">
  <div class="grid vertically-aligned">
    <div class="desktop-six tablet-six pink">
      <div class="container">
        <div class="skeleton"></div>
        <div class="skeleton"></div>
      </div>
    </div>
    <div class="desktop-six tablet-six orange">
      <div class="container">
        <div class="skeleton"></div>
        <div class="skeleton"></div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html, body {
  height: 100%;
}

h2 {
  letter-spacing: 2.2px;
  font-weight: 100;
  font-size: 2em;
  text-align: center;
}

* {
  box-sizing: border-box;
}

@tablet-breakpoint: 991px;
@phone-breakpoint: 661px;

.centered {
  justify-content: center !important;
}

.reverse {
  flex-flow: row-reverse wrap !important;
}

.vertically-aligned {
  height: 100%;
  align-items: center !important;
}

.grid {
  display: flex;
  flex-flow: row wrap;
  justify-content: inherit;
  align-items: flex-start;
  width: 100% !important;
  padding: 0rem;
  .container {
    color: white;
    min-height: 100px;
    padding: 10px;
    p {
      text-align: center;
      font-size: 24px;
      font-weight: bold;
    }
    .skeleton {
      height: 25px;
      width: 80%;
      background-color: rgba(0, 0, 0, 0.15);
      display: block;
      margin: 27px auto;
    }
  }
}

.flex-size(@col: 6, @gutter: 1%) {
  flex-basis: (100% / (12 / @col)) - @gutter;
}

[class*='desktop-'], [class*='tablet-'], [class*='phone-'] {
  margin: 0 0.5% 10px 0.5%;
}

.no-gutters {
  [class*='desktop-'], [class*='tablet-'], [class*='phone-'] {
    margin: 0 0 10px 0;
  }
}

.relaxed-gutters {
  [class*='desktop-'], [class*='tablet-'], [class*='phone-'] {
    margin: 0 1% 10px 1%;
  }
}

// flex function
.viewport-columns(@screen-type: desktop, @gutter: 1%) {
  [email protected]{screen-type}-one {
    .flex-size(1, @gutter);
  }

  [email protected]{screen-type}-two {
    .flex-size(2, @gutter);
  }

  [email protected]{screen-type}-three {
    .flex-size(3, @gutter);
  }

  [email protected]{screen-type}-four {
    .flex-size(4, @gutter);
  }

  [email protected]{screen-type}-five {
    .flex-size(5, @gutter);
  }

  [email protected]{screen-type}-six {
    .flex-size(6, @gutter);
  }

  [email protected]{screen-type}-seven {
    .flex-size(7, @gutter);
  }

  [email protected]{screen-type}-eight {
    .flex-size(8, @gutter);
  }

  [email protected]{screen-type}-nine {
    .flex-size(9, @gutter);
  }

  [email protected]{screen-type}-ten {
    .flex-size(10, @gutter);
  }

  [email protected]{screen-type}-eleven {
    .flex-size(11, @gutter);
  }

  [email protected]{screen-type}-twelve {
    .flex-size(12, @gutter);
  }
}

// desktop only container
@media (min-width: @tablet-breakpoint) {
  .viewport-columns(desktop);
  .no-gutters {
    .viewport-columns(desktop, 0%);
  }
  .relaxed-gutters {
    .viewport-columns(desktop, 2%);
  }
}

@media (max-width: @tablet-breakpoint) {
  .viewport-columns(tablet);
  .no-gutters {
    .viewport-columns(desktop, 0%);
  }
  .relaxed-gutters {
    .viewport-columns(desktop, 2%);
  }
}

@media (max-width: @phone-breakpoint) {
  .viewport-columns(phone);
  .no-gutters {
    .viewport-columns(desktop, 0%);
  }
  .relaxed-gutters {
    .viewport-columns(desktop, 2%);
  }
}

// demo backgrounds

.sky-blue {
  background: #92AFD7;
}

.dark-blue {
  background: #5A7684;
}

.slate-grey {
  background: #395B50;
}

.jungle-green {
  background: #071E22;
}

.orange {
  background: #DB5860;
}

.pink {
  background: #94618E;
}

.brown {
  background: #230903;
}

.vertical-container {
  margin-bottom: 100px;
  height: 600px;
}

              
            
!

JS

              
                
              
            
!
999px

Console