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

              
                <div class="container">
  <div>
    <p>The Bootstrap Grid is based on 12 units.<br>
      You can "distribute" those 12 units the way you want. </p>
  </div>
  <div class="row" id="basis">
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
    <div class="col-sm-1 unit">
      <p>1 unit</p>
    </div>
  </div>
  <div class="row" id="example1">
    <div class="col-xs-12 col-sm-4" id="four">
      <p>I take 4 units out of 12 and I'm not offset so I start from the left</p>
      <p>When the screen is Xtra small I take 12 units (look at the html)</p>
      <p>I am in the yellow row</p>
    </div>
    <div class="col-xs-12 col-sm-1 col-sm-offset-7" id="lonely">
      <p>1 unit wide, offset by 7 (so offset from where I SHOULD be</p>
    </div>
  </div>
  <div class="row" id="example2">
    <div class="col-xs-12 col-sm-3 col-sm-offset-2" id="offset">
      <p>I am 3 units wide, and I'm offset by 2 units.</p>
      <p>When Xsmall, I take 12 units</p>
    </div>
    <div class="col-xs-12 col-sm-5" id="five">
      <p>I am 5 units wide and I'm not offset so I start right next to the blue column</p>
      <p>when xsmall I take 12 units</p>
    </div>
  </div>
  <div class="row" id="example3">
    <div class="col-xs-12 col-sm-6">
      <p>The row takes 12 units.<br>
        I'm a 6-unit column but my background-color is that of the row, because Timotheap didn't specify anything else.</p>
    </div>
    <div class="col-xs-12 col-sm-6">
      <div class="row" id="innerRow">
        <p>I look like column but I'm a row. So I'm 12 units wide in the space given to me</p>
        <div class="col-xs-12 col-sm-6" id="innerCol">
          <p style="color:white">I'm a 6-unit wide column in the inner row (yes, look, I'm exactly half of the inner row, and my html specifies col-sm-6), and my height is 50% of the row because timotheap decided so.</p>
        </div>
      </div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body{
  padding-top:50px;
  padding-bottom:50px;
}
.row{
  height:300px;
 }
#basis{
  background-color:lightcoral;
}
.unit{
  background-color:lightcyan;
  height:100%;
  border:1px solid lightcoral;
}
#example1{
  background-color:yellow;
}
#four{
  background-color:palegreen;
  height:100%;  
  border:3px solid yellow;
  
}
#lonely{
  background-color:palevioletred;
  height:100%;
  border:3px solid yellow;
}
#five{
  background-color:orange;
  height:100%;
  border:3px solid pink;
}
p{
  padding-top:10px;
}
#example2{
  background-color:pink;
}

#offset{
  background-color:paleturquoise;
  height:100%;
  border:3px solid pink;
}

#example3{
  background-color:violet;
  }

#innerRow{
  background-color:lightseagreen;
  border:3px solid violet;
}

#innerCol{
  background-color:purple;
  height:50%;
}
              
            
!

JS

              
                
              
            
!
999px

Console