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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

              <header id="page-header" role="banner">
  <h1>Nested Layouts with Less Divs</h1>
</header><!-- /header#page-header -->

<div id="main" role="main">
  <p>Cupcake ipsum dolor sit amet croissant gummies pie macaroon. Wafer brownie bonbon gummi bears pastry toffee. Unerdwear.com soufflé candy I love ice cream apple pie tart croissant. Jujubes marshmallow sugar plum cotton candy marzipan sweet gummi bears chocolate bar jelly-o. Bonbon pie lollipop cookie caramels ice cream liquorice. Apple pie chocolate bar cheesecake bonbon macaroon carrot cake. Sugar plum I love brownie powder dessert pudding gingerbread soufflé.</p>
</div><!-- /div#main -->

<footer id="page-footer">
  Lynn Wallenstein - <a href="http://www.lynn.io">www.Lynn.io</a>
</footer><!-- /footer#page-footer -->

              $nested-width-size: 800px;
$nested-margin: $nested-width-size / 2;

%nested {
  padding-left: -moz-calc(50% - #{$nested-margin});
  padding-left: -webkit-calc(50% - #{$nested-margin});
  padding-left: calc(50% - #{$nested-margin});
  padding-right: -moz-calc(50% - #{$nested-margin});
  padding-right: -webkit-calc(50% - #{$nested-margin});
  padding-right: calc(50% - #{$nested-margin});

#page-footer {
  @extend %nested;

#page-header {
  background-color: blue;
  color: white;
  padding-top: 20px;
  padding-bottom: 20px;
  h1 {
    margin: 0;
} // #page-header

#main {
  background-color: black;
  color: white;

  p {
    margin: 0;
    padding: 10px 0 10px 0;
} // #main

#page-footer {
  border-top: 1px solid gray;
  padding-top: 20px;

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................