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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="row">
  <h1> Just Say No To Floats!</h1>
  <h3>Clearing floats can be tricky for a lot of people. By using inline-block in place of floats we can avoid all that mess!</h3>
</header>



<!-- start of 12 one column section -->
<section class="row">
    <div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p> 
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div>
</section>
<!-- end of 12 one column section -->

<!-- start of elevenAndOne section -->
<section class="row mix">
    <div class="grid-11">
      <p>11/12</p>
    </div><!--
 --><div class="grid-1">
      <p>1/12</p>
    </div>
</section>
<!-- end of elevenAndOne section -->

<!-- start of six column section -->
<section class="row">
    <div class="grid-2">
      <p>2/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div>
</section>
<!-- end of sixColumns section -->

<!-- start of tenAndTwoColumn section -->
<section class="row mix">
    <div class="grid-10">
      <p>10/12</p>
    </div><!--
 --><div class="grid-2">
      <p>2/12</p>
    </div>
</section>
<!-- end of tenAndTwoColumn section -->

<!-- start of threeColumns section -->
<section class="row">
    <div class="grid-3">
      <p>3/12</p>
    </div><!--
 --><div class="grid-3">
      <p>3/12</p>
    </div><!--
 --><div class="grid-3">
      <p>3/12</p>
    </div><!--
 --><div class="grid-3">
      <p>3/12</p>
    </div>
</section>
<!-- end of threeColumns section -->

<!-- start of nineAndthreeColumn section -->
<section class="row mix">
    <div class="grid-9">
      <p>9/12</p>
    </div><!--
 --><div class="grid-3">
      <p>3/12</p>
    </div>
</section>
<!-- end of nineAndthreeColumn section -->

<!-- start of fourColumns section -->
<section class="row">
    <div class="grid-4">
      <p>4/12</p>
    </div><!--
 --><div class="grid-4">
      <p>4/12</p>
    </div><!--
 --><div class="grid-4">
      <p>4/12</p>
    </div>
</section>
<!-- end of fourColumns section -->

<!-- start of eightAndfourColumn section -->
<section class="row mix">
    <div class="grid-8">
      <p>8/12</p>
    </div><!--
 --><div class="grid-4">
      <p>4/12</p>
    </div>
</section>
<!-- end of eightAndfourColumn section -->

<!-- start of sevenAndfiveColumn section -->
<section class="row mix">
    <div class="grid-7">
      <p>7/12</p>
    </div><!--
 --><div class="grid-5">
      <p>5/12</p>
    </div>
</section>
<!-- end of sevenAndfiveColumn section -->

<!-- start of sixColumns section -->
<section class="row">
    <div class="grid-6">
      <p>6/12</p>
    </div><!--
 --><div class="grid-6">
      <p>6/12</p>
    </div>
</section>
<!-- end of sixColumns section -->

<!-- start of grid-12 section -->
<section class="row">
    <div class="grid-12">
      <p>Full</p>
    </div>
</section>
<!-- end of grid-12 section -->
              
            
!

CSS

              
                //colors
$lightGrey: #ECF0F1;
$red: #C0392B;
$midnight: #2C3E50;

//fonts
@import url(https://fonts.googleapis.com/css?family=Lato:300,400);
@import url(https://fonts.googleapis.com/css?family=Bevan);

* {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

body {
  background: $midnight;
  color: lighten($midnight, 25%);
  font-family: 'Lato', 'sans-serif';
  font-size:  100%;
  margin: 0;
  padding: 0;
}

section[class*="mix"] div:last-child {
  color: #fff;
  background: darken($lightGrey, 25%);
  text-shadow: none;
}
header[class="row"] {
  font-size: 1em;
}

h1 {
  color: $red;
  font-family: 'Bevan', cursive;
  font-size: 3em;
  font-weight: bold;
  text-align: center;
  text-shadow: 3px 2px 0px darken($midnight, 5%), 5px 4px 0px darken($midnight, 4%);
}

h3 {
  color: #fff;
  font-weight: 300;
  text-align: center; 
  text-shadow: 3px 2px 0px darken($midnight, 5%), 5px 4px 0px darken($midnight, 4%);
}
/////////////////////////////////////////////////
//Above styles for presentational purposes only
////////////////////////////////////////////////

.row {
  display: block;
  font-size: 0.75em; 
  margin: 0;
  //provide padding for small screens
  padding: 0 1.5em;
  text-align: center; 
  width: 100%;
  
  @media (min-width: 37.5em) {
    //add spacing between stacked  rows
    margin: 1em 0;
    //large screen padding
    padding: 0 2.5em;
  }
   
}

//grid mixin
$col-width    : 65px;
$gutter-width : 20px;
$columns      : 12;

@for $i from 1 through $columns {

    // Set container width relative to user variables
    $width: ($col-width * $columns) + ($gutter-width * ($columns - 1));

    // First, calculate grid size in pixels
    $grid: ($col-width * $i) + ($gutter-width * ($i - 1));

    // Then, calculate the responsive grid 
    $grid: ($grid / $width) * 100%;

    // Generate the grid classes
    .grid-#{$i} {
        width: 100%;
        @media(min-width: 37.5em) {
            width: $grid;
        }
    }
}

@media(min-width: 37.5em) {
    div[class*="grid"] + div[class*="grid"] {
        margin-left: 2%;
    }
}

//set up for all grid columns
div[class*="grid"] { 
  background: $lightGrey;
  display: inline-block;
  margin: 1em 0;
  padding: 0.5em;
  vertical-align: top;
  
  @media (min-width: 37.5em) {
    margin: 0;
  }
}











              
            
!

JS

              
                //However you get your column widths it is the inline block that //provides the magic.  
              
            
!
999px

Console