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

              
                <h1>Jeet Grid</h1>
<p>* In this example we use a mobile first approach</p>
<p>* Resize the window to see how the <strong>cycle</strong> and <strong>uncycle</strong> variables work</p>
<hr>
<div class="wrapper">
  <h3>Four equal-sized columns using the <strong>col/columns</strong> mixin</h3>
  <h4>
    Possible parameters:
    <p>
      <strong>ratios</strong> (default:1), <strong>offset</strong> (default:0), <strong>cycle</strong> (default:0), <strong>uncycle</strong> (default:0), <strong>gutter</strong> (default:3)
    </p>
  </h4>
  <div>
    <h2>Column-1</h2>
    <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p>
  </div>
  <div>
    <h2>Column-2</h2>
    <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p>
  </div>
  <div>
    <h2>Column-3</h2>
    <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p>
  </div>
  <div>
    <h2>Column-4</h2>
    <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat.</p>
  </div>
</div>
<hr>
<div class="nested-wrapper">
  <h3>An example of using <strong>nested</strong> columns</h3>
  <h4>When the browser window has a width of 600px and up, the actual nesting takes place.</h4>
  <div class="first">
    <h2>Nested columns</h2>
    <p>Notice that we pass two values (i.e. 1/2 2/3) in the <strong>ratios</strong> variable of the <strong>col</strong> mixin. The first value is the column's width and the second one is its parent ratio. Doing that we maintain consistent gutters as we nest.</p>
  </div>
  <div class="second">
    <div>
      <h2>Column-nested-1</h2>
    </div>
    <div>
      <h2>Column-nested-2</h2>
    </div>
  </div>
 </div>
              
            
!

CSS

              
                //If you want to see the actual grid uncomment the "edit" (alias debug) mixin
//@include edit(tomato);
//Defining the "ratios", "offset" or/and "gutter" variables by using decimals (e.g. .75), fractions (e.g. 1/4) or even a combination of them (.75/4).

@mixin col-styles {
  box-sizing: border-box;
  border: 1px solid #ededed;
  margin-bottom: 10px;
} 

body {
  background: lighten(#ededed, 6%);
  font-family: 'Georgia', sans-serif;
  text-align: center;
  line-height: 1.5;
}

h1 {
  font-weight: 700;
}

h1 ~ p {
  color: tomato;
  font-style: italic;
}

h3, h4 {
  font-weight: normal;
}

h3 {
  font-style: italic;
}

hr {
  border-color: #ededed;
}

.wrapper {
  @include center(1200px, 10px);
  
  div {
    @include col-styles;
    
    @media screen and (min-width: 600px) {
      @include col(1/2, $cycle: 2, $gutter: 4);
    }
    
    @media screen and (min-width: 900px) {
      @include col(1/4, $cycle: 4, $uncycle: 2);
    }
    
    p {
      padding: 10px;
    }
  }
}

.nested-wrapper {
  @include center(1000px, 10px);
  
  div {
    @include col-styles;

    @media screen and (min-width: 600px) {
      &.first {
        @include col(1/3);
      }
    
      &.second {
        padding: 10px;
        @include col(2/3);
      
        div {
          @include col(1/2 2/3);
        }
      }     
    }
    
    p {
      padding: 10px;
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console