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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <!--BEGIN: flex parent-->
<div class="flex-parent">
  
  <div class="flex100 orange">
    
    <p>To make a complicated web layout as easily as possible, flexbox is the way to go.</p>
    
    <p>We'll make seperate classes for everything to make it easy to re-use later.</p>
    
    <p>This first box we'll make 100% wide and make it orange by adding class="flex100 orange" in the div.</p>
    
  </div>
  
  <div class="flexy yellow">
    <p>To make multiple columns we'll add the class of 'flexy' to them and in the CSS give flexy the value of flex: 1;  this just means that the item is one flex unit wide, keeping them all even widths.  </p>
  </div>
  <div class="flexy yellow">
    <p>So if you have three of them</p>
  </div>
  <div class="flexy yellow">
    <p>they'd be 1/3 or the width of the row</p>
  </div>
  
  <div class="flex100 pink">
    
    <p>Let's add another flex100 div to take up the entire width and make a break in the design.  We'll make this one pink!</p>
    
  </div>
  
  <div class="flexy blue">
    <p>Now let's try two columns, for that you'd just add two flexy divs.</p>
  </div>
  
  <div class="flexy blue">
    <p>Here's the second one</p>
  </div>
    <div class="flex100 white">
    <p class="credit">This tutorial brought to you by <a href="http://webdesignlabs.org" title="An after-school web design program for Brooklyn public schools.">Web Design Labs</a></p>
  </div>
  
  <div class="flexy green">
    <p>Keep</p>
  </div>
  
  <div class="flexy green">
    <p>F</p>
  </div>
  
  <div class="flexy green">
    <p>L</p>
  </div>
  
  <div class="flexy green">
    <p>E</p>
  </div>
  
  <div class="flexy green">
    <p>X</p>
  </div>
  
  <div class="flexy green">
    <p>I</p>
  </div>
  
  <div class="flexy green">
    <p>N</p>
  </div>
  
</div>
<!--END: flex parent-->
            
          
!

CSS

            
              .html, body {
  background: black;
}

.flex-parent {
  
    // all the divs that are in here we'll add some padding and margin so they look good, you can play around with these values of course
  div {
    padding: 3em;
    margin: .5em;
  }
  
  // Make the container div have the display property of 'flex'
  display: flex;
  
  // we use row wrap to make the site function like a bunch of rows of content. Each can have as many things in it as you want, just break them up with flex100 divs
  flex-flow: row wrap;
  
  .flex100 {
    flex: 1 100%;
//    flex-basis: 100%;
//    flex: 1;
//    min-width: 100%;
  }
  .flexy {
    flex: 1;
  }
}

//credit
.credit {
  text-align: right;
  font-size: small;
}

//colors
.orange {
  background: orange;
}
.yellow {
  background: yellow;
}
.green {
  background: green;
}
.blue {
  background: blue;
  color: white;
  a {
   color: white; 
  }
}
.pink {
  background: pink;
}
.white {
  background: white;
}
            
          
!

JS

            
              
            
          
!
999px

Console