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 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.

Quick-add: + add another resource

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.

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.

            
              <h1>Don't Overthink It Grids <em>(while we wait for flexbox)</em></h1>

<h2>Grid-pad using last-of-type</h2>
<div class="grid grid-pad">
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
</div>

<h2>Grid-pad not using last-of-type</h2>
<div class="grid grid-pad2">
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
</div>

<h2>Grid-pad with large outer padding, using last-of-type</h2>
<div class="grid grid-pad3">
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
</div>

<h2>Grid-pad with large outer padding, not using last-of-type</h2>
<div class="grid grid-pad4">
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
   <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
  <div class="col-1-8">
     <div class="module">
     		<h3>1/8</h3>
     </div>
   </div>
</div>


            
          
!
            
              @import "compass/css3";

* {
  @include box-sizing(border-box);
}

$pad: 20px;
$pad2: 50px;

.grid {
  background: white;
  margin: 0 0 $pad 0;
  
  &:after {
    /* Or @extend clearfix */
    content: "";
    display: table;
    clear: both;
  }
}

[class*='col-'] {
	float: left;
  padding-right: $pad;
  .grid &:last-of-type {
  	padding-right: 0;
  }
}
.col-2-3 {
	width: 66.66%;
}
.col-1-3 {
	width: 33.33%;
}
.col-1-2 {
	width: 50%;
}
.col-1-4 {
	width: 25%;
}
.col-1-8 {
	width: 12.5%;
}

.module {
  padding: $pad;
  background: #eee;
}

/* Opt-in outside padding */
.grid-pad {
  padding: $pad 0 $pad $pad;
  [class*='col-']:last-of-type {
    padding-right: $pad;
  }
}

/* Opt-in outside padding: v2 */
.grid-pad2 {
  padding: $pad;
}

.grid-pad3 {
  padding: $pad2 0 $pad2 $pad2;
  [class*='col-']:last-of-type {
    padding-right: $pad2;
  }
}

.grid-pad4 {
  padding: $pad2;
}


body {
	padding: 10px 50px 200px;
  background: url(https://subtlepatterns.com/patterns/dark_wall_@2X.png);
  background-size: 300px 300px;
}
h1 {
  color: white;
  em {
  	color: #666;
    font-size: 16px;
  }
}
h2 {
  color: white;
}
            
          
!
999px
Loading ..................

Console