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

              
                <main>
  <div class="row">  <!--   This is the first row -->
    <div class="col-1">One column</div>
    <div class="col-1">One column</div>
    <div class="col-1">One column</div>
    <div class="col-1">One column</div>
  </div>
 
  <div class="row">   <!--   this is the second row -->
    <div class="col-2">Two columns</div>
    <div class="col-2">Two columns</div>
  </div>
  
  <div class="row">  <!--   this is the third row -->
    <div class="col-1">One column</div>
    <div class="col-3">Three columns</div>
  </div>
  
  <div class="row"><!--   this is the fourth row -->
    <div class="col-4">Four columns</div>
  </div>
</main>
              
            
!

CSS

              
                .row {
  display: flex;
  flex-flow: row wrap;  /*   flex-flow:row wrap; is shorthand for flex-direction and flex-wrap */
  justify-content: space-around;
}
 

/* Flex Basis are the properties that apply to the elements in the container.
Flex basis controls the size of the element before it is manipulated by the other flexbox properties.
The flex-basis property specifies the initial length of a flexible item.  The 1% of extra space is applied to the left and right of each box by flebox space around property.

Remember Flex: 0 1 auto; is shorthand for grow, shrink and basis */


.col-1 {
  flex-basis: 24%;  /*The flex-basis property specifies the initial length of a flexible item.*/
}
.col-2 {
  flex-basis: 49%;
}
.col-3 {
  flex-basis: 74%;
}
.col-4 {
  flex-basis: 99%;
 
}

/* basic page styling */

*, *:before, *:after {
  box-sizing: border-box;
}

body {
  font-family: lato, sans-serif;
  margin: 0;
  font-weight:bolder;
}
main > div > div {
  padding: 1em;
  color: white;
  text-align: center;
}
.col-1 {
  background-color: coral;
}
.col-2 {
  background-color: lightskyblue;
}
.col-3 {
  background-color: lightseagreen;
}
.col-4 {
  background-color: limegreen;
}
              
            
!

JS

              
                
              
            
!
999px

Console