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

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="wrap">
  <div class="row">
		<div class="sidebar col">sidebar</div>
		<div class="content col">content</div>
	</div>

	<div class="row">
		<div class="half col">half1</div>
		<div class="half col">half2</div>
	</div>

	<div class="row">
		<div class="third col">third1</div>
		<div class="third col">third2</div>
		<div class="third col">third3</div>
	</div>

	<div class="row">
		<div class="fourth col">fourth1</div>
		<div class="fourth col">fourth2</div>
		<div class="fourth col">fourth3</div>
		<div class="fourth col">fourth4</div>
	</div>

	<div class="row">
		<div class="fifth col">fifth</div>
		<div class="fifth col">fifth</div>
		<div class="fifth col">fifth</div>
		<div class="fifth col">fifth</div>
		<div class="fifth col">fifth</div>
	</div>

	<div class="row">
		<div class="sixth col">sixth1</div>
		<div class="sixth col">sixth2</div>
		<div class="sixth col">sixth3</div>
		<div class="sixth col">sixth4</div>
		<div class="sixth col">sixth5</div>
		<div class="sixth col">sixth6</div>
	</div>
</div>
              
            
!

CSS

              
                @import "compass/css3";

// column mixins
@mixin grid($target, $context){
	width: (($target/$context)*100%);
}

// margin mixins
@mixin mleft($target, $context){
	margin-left: (($target/$context)*100%);
}

@mixin mright($target, $context){
	margin-right: (($target/$context)*100%);
}

// basic clearfix
.clearfix {
    zoom:1;
    &:before, &:after {
        content: "\0020";
        display: block;
        height: 0;
        overflow: hidden;
    }
    &:after {
        clear: both;
    }
}

// set a max width of 960 and show ugly salmon background
.wrap {
  max-width: 960px;
  margin: 0 auto;
  background: salmon;
}

// fire in the hole!
.row {
  @extend .clearfix;
}

// column styles for presentation
.col {
  float: left; // required, duh
  background: #eee;
	margin-bottom: 1em;
	padding: 1em 0;
	text-align: center;
  &:hover  {
    background: darken(#eee, 5%);
  }
}

// real world example  260+80+620=960
.sidebar {
  @include grid(260, 960);
}

.content {
  @include grid(620, 960);
  @include mleft(80, 960);
}

// presentational boxes
.half {
  @include grid(480, 960);
}

.third {
  @include grid(320,  960);
}

.fourth {
  @include grid(240, 960);
}

.fifth {
  @include grid(192, 960);
}

.sixth {
  @include grid(160, 960);
}

              
            
!

JS

              
                
              
            
!
999px

Console