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

              
                <div id="ost-container">
  <div class="fleft w100">Header Title</div>
  <div class="fleft w50">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eu sollicitudin tellus, quis commodo odio. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris cursus.</div>
  <div class="fleft w50">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dui arcu, faucibus nec scelerisque vitae, rutrum ut diam. Quisque at magna scelerisque, efficitur diam a, volutpat nunc. Etiam in mauris.</div>
  <div class="fleft w25">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pulvinar luctus risus, ac mattis orci feugiat quis. Etiam ac aliquet tellus, ac sodales dui.</div>
  <div class="fleft w25">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tincidunt a risus ac sagittis. Quisque tincidunt maximus fermentum. Donec a purus massa.</div>
  <div class="fleft w25">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rhoncus arcu ante, id luctus ante scelerisque quis.</div>
  <div class="fleft w25">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum viverra consequat interdum. Quisque scelerisque orci vel blandit vehicula.</div>
</div>
              
            
!

CSS

              
                /* Not relevant to the lesson. Just setting up a parent div with a max width. */
#ost-container{
  max-width: 870px;
  margin: 0 auto;
}
/* Floating to make the blocks stack side-by-side. */
.fleft{
  float: left;
  text-align: left;
}
.w100{
  width: 100%;
  height: 200px;
  line-height: 200px;
  font-size: 70px;
  background: #ed8034;
  text-align: center;
  border-bottom: 1px solid #000000;
}
.w50{
  width: calc(50% - 10px);
  min-height: 70px;
  font-size: 14px;
  background: #feb123;
  padding: 5px;
}
.w25{
  width: calc(25% - 23px * 2);
  min-height: 100px;
  font-size: 12px;
  color: #ffffff;
  background: #2184cd;
  margin: 20px 10px;
  padding: 10px;
  border: 3px solid #000;
}
/* Some adjustments needed for mobile browsing. */
@media screen and (max-width: 767px){
  .w100{
    font-size: 40px;
  }
  .w50{
    width: calc(100% - 10px);
    min-height: auto;
  }
  .w25{
    width: calc(100% - 23px * 2);
    min-height: auto;
    margin: 10px;
  }
  /* This will keep the original 20px spacing between w50 and w25 for just the first w25 div. */
  #ost-container > :nth-child(4){
    margin-top: 20px;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console