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

Auto Save

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 class="text-center">Foundation 5</h1>
<h2 class="text-center">Resize the window to see the grid that's being used.</h2>
<hr>

<!--SMALL GRID-->
<div class="row text-center show-for-small-only">        
  <h3>At this point, the window width is up to 640px <strong></strong>. You'll use Foundation's grid for <strong class="bg-color">small screens</strong>.</h3>
  <h4>The size of each row can't exceed the 1000px.</h4>
  <hr>
  <h4>Each row can have up to 12 columns.</h4>
  <hr>
  <h4>For default grid, the class prefix you can use to set the size of your columns is <code>small-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>small-6</code> class.</p>
  <p>Keep in mind that in case you'll not specify a column size for small screens, they will be appearing stacked. That means, they will occupy the full width of their container (<code>small-12</code>).</p>
  <hr>
  <h4>For block grid, the class prefix you can use to set the size of your columns is <code>small-block-grid-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>small-block-grid-6</code> class.</p>
  <p>Using <strong>offset</strong> classes (for example, <code>small-offset-2</code>) you can center or move columns to the right. These classes change the <code>margin-left</code> value of each column.</p>
  <p>Using <strong>push & pull</strong> classes (for example, <code>small-push-2</code>) you can move columns to the left and right respectively. These classes change the <code>left</code> and <code>right</code> values of each column.</p>
  <p>Using <strong>visibility</strong> classes (for example, <code>hide-for-small-only</code>) you can adjust the content that will be appearing in this viewport size.</p>
  <p>Demo by George Martskoukos. <a href="http://www.sitepoint.com/grid-system-comparison-bootstrap-vs-foundation" target="_blank">See article</a>.</p>
</div>

<!--MEDIUM GRID-->
<div class="row text-center show-for-medium-only">
  <h3>At this point, the window width is 641px and up <strong></strong>. You'll use Foundation's grid for <strong class="bg-color">medium screens</strong>.</h3>
  <h4>The size of each row can't exceed the 1000px.</h4>
  <hr>
  <h4>Each row can have up to 12 columns.</h4>
  <hr>
  <h4>For default grid, the class prefix you can use to set the size of your columns is <code>medium-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>medium-6</code> class.</p>
  <p>Keep in mind that in case you'll not specify a column size for medium screens, they will inherit the styles from the small screens.</p>
  <hr>
  <h4>For block grid, the class prefix you can use to set the size of your columns is <code>medium-block-grid-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>medium-block-grid-6</code> class.</p>
  <hr>
  <p>Using <strong>offset</strong> classes (for example, <code>medium-offset-2</code>) you can center or move columns to the right. These classes change the <code>margin-left</code> value of each column.</p>
  <p>Using <strong>push & pull</strong> classes (for example, <code>medium-push-2</code>) you can move columns to the left and right respectively. These classes change the <code>left</code> and <code>right</code> values of each column.</p>
  <p>Using <strong>visibility</strong> classes (for example, <code>show-for-medium-only</code>) you can adjust the content that will be appearing in this viewport size.</p>
  <hr>
  <p>Demo by George Martskoukos. <a href="http://www.sitepoint.com/grid-system-comparison-bootstrap-vs-foundation" target="_blank">See article</a>.</p>
</div>

<!--LARGE GRID-->
<div class="row text-center show-for-large-only">
  <h3>At this point, the window width is 1025px and up <strong></strong>. You'll use Foundation's grid for <strong class="bg-color">large screens</strong>.</h3>
  <h4>The size of each row can't exceed the 1000px.</h4>
  <hr>
  <h4>Each row can have up to 12 columns.</h4>
  <hr>
  <h4>For default grid, the class prefix you can use to set the size of your columns is <code>large-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>large-6</code> class.</p>
  <p>Keep in mind that in case you'll not specify a column size for large screens, they will inherit the styles from the previous screens.</p>
  <hr>
  <h4>For block grid, the class prefix you can use to set the size of your columns is <code>large-block-grid-#</code>.</h4>
  <p>For instance, if you want two equal-sized columns, you'll use the <code>large-block-grid-6</code> class.</p>
  <hr>
  <p>Using <strong>offset</strong> classes (for example, <code>large-offset-2</code>) you can center or move columns to the right. These classes change the <code>margin-left</code> value of each column.</p>
  <p>Using <strong>push & pull</strong> classes (for example, <code>large-push-2</code>) you can move columns to the left and right respectively. These classes change the <code>left</code> and <code>right</code> values of each column.</p>
  <p>Using <strong>visibility</strong> classes (for example, <code>show-for-large-only</code>) you can adjust the content that will be appearing in this viewport size.</p>
  <hr>
  <p>Demo by George Martskoukos. <a href="http://www.sitepoint.com/grid-system-comparison-bootstrap-vs-foundation" target="_blank">See article</a>.</p>
</div>

<!--XLARGE GRID-->
<div class="row text-center show-for-xlarge-only">
  <h3>At this point, the window width is 1441px and up <strong></strong>.</h3>
  <p>In order to be able to use Foundation's grid for <strong>xlarge devices</strong> you have to activate it. To do this, uncomment and set the <code>$include-xl-html-grid-classes</code> and <code>$include-xl-html-block-grid-classes</code> variables to <code>true</code>. These variables can be found in the <code>_settings.scss</code> partial.</p>
  <p>Keep in mind that in case you'll not specify a column size for xlarge screens, they will inherit the styles from the previous screens.</p>
  <p>Demo by George Martskoukos. <a href="http://www.sitepoint.com/grid-system-comparison-bootstrap-vs-foundation" target="_blank">See article</a>.</p>
</div>

<!--XXLARGE GRID-->
<div class="row text-center show-for-xxlarge-only">
  <h3>At this point, the window width is 1921px and up <strong></strong>.</h3>
  <p>In order to be able to use Foundation's grid for <strong>xxlarge devices</strong> you have to activate it. To do this, uncomment and set the <code>$include-xl-html-grid-classes</code> and <code>$include-xl-html-block-grid-classes</code> variables to <code>true</code>. These variables can be found in the <code>_settings.scss</code> partial.</p>
  <p>Keep in mind that in case you'll not specify a column size for xxlarge screens, they will inherit the styles from the previous screens.</p>
  <p>Demo by George Martskoukos. <a href="http://www.sitepoint.com/grid-system-comparison-bootstrap-vs-foundation" target="_blank">See article</a>.</p>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700);

body, h1, h2, h3, h4 {
  font-family: 'Source Sans Pro', sans-serif;
}

h1 {
  font-weight: 700;
}

a {
  color: white;
}

h3 {
  margin-bottom: 25px;
}

.bg-color {
  background: #bdbd00;
  padding: 3px;
}

h4, p {
  margin-bottom: 15px;
}

@media only screen and (max-width:40em) {
  body {
    background: lightblue;
  }
}

@media only screen and (min-width: 40.063em) {
  body {
    background: #4baac8;
  }
}

@media only screen and (min-width: 64.063em) {
  body {
    background: LightSteelBlue;
  }
}

@media only screen and (min-width: 90.063em) {
  body {
    background: #688ec0;
  }
}

@media only screen and (min-width: 120.063em) {
  body {
    background: #cdd9ea;
  }
}
              
            
!

JS

              
                $(window).on('load resize', function(){
  var $browserWidth = $(window).width();
  $('h3 strong:first-child').text('(' + $browserWidth + 'px)').css('color', 'white');
});
              
            
!
999px

Console