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 class="content">
    <h1>Item 1</h2>  
    
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed viverra nunc ac urna tristique, nec vehicula orci hendrerit. Curabitur tincidunt vitae turpis ut volutpat. Mauris lobortis diam non lacus ultrices, non bibendum tellus imperdiet. In elementum augue magna, vitae lobortis nibh auctor non. Curabitur maximus ante vel rutrum dignissim. Donec aliquet quis libero vitae mollis. Sed egestas vulputate turpis quis interdum.</p>
  </div><!--/content-->
  
   <div class="content">
     <h1>Item 2</h2> 
     
     
     
       <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed viverra nunc ac urna tristique, nec vehicula orci hendrerit. Curabitur tincidunt vitae turpis ut volutpat. Mauris lobortis diam non lacus ultrices, non bibendum tellus imperdiet. In elementum augue magna, vitae lobortis nibh auctor non. Curabitur maximus ante vel rutrum dignissim. Donec aliquet quis libero vitae mollis. Sed egestas vulputate turpis quis interdum.</p>
  </div><!--/content-->
  
   <div class="content">
     <h1>Item 3</h2> 
     
       <p>Sed eu convallis dui, vitae euismod massa. Quisque quis urna eu lectus aliquet ultrices. Pellentesque hendrerit, justo a euismod placerat, eros nibh ornare leo, quis pretium turpis quam et lectus. Praesent sed posuere ante. Cras fringilla urna dolor, at tempus tellus posuere ac. Maecenas ut elementum metus. Proin feugiat et ligula eu consectetur. Integer ut lacinia nisi, nec egestas elit. </p>

  </div><!--/content-->
  
   <div class="content">
     <h1>Item 4</h2> 
     
     <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed viverra nunc ac urna tristique, nec vehicula orci hendrerit. Curabitur tincidunt vitae turpis ut volutpat. Mauris lobortis diam non lacus ultrices, non bibendum tellus imperdiet. In elementum augue magna, vitae lobortis nibh auctor non. Curabitur maximus ante vel rutrum dignissim. Donec aliquet quis libero vitae mollis. Sed egestas vulputate turpis quis interdum.</p>
  </div><!--/content-->
  
  
  
</div><!--/container-->
              
            
!

CSS

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

.container {
  background:lightBlue;
  max-width:1200px;
  margin:50px auto;
  font-family:sans-serif;
  
  /*FLEXBOX*/
  display:flex;  
  flex-wrap: wrap;
}

.container h1 {  
  margin:0 0 15px;
}



.content h1{
  font-size:2rem;
}

.content p{
  font-size:1.5rem;
}

.content {
  background:blue;
  color:#FFF;
  padding:15px;
  width:15%;
  margin:10px;
  flex-grow:1;
}


.content:nth-child(1) {
  order:2;
  flex-grow:4;
}

.content:nth-child(2) {
  order:4;
 
}

.content:nth-child(3) {
  order:3; 
}

.content:nth-child(4) {
  order:1;
 flex-grow:3;
}





@media screen and (max-width:800px){
  .content {
    width:100%;
  }
  
  .content:nth-child(1) {
    order:1;
  }
  .content:nth-child(2) {
    order:2;
  }
  .content:nth-child(3) {
    order:3;
  }
  .content:nth-child(4) {
    order:4;
  }
  
}

.no-flexbox .content{
  float:left;
}


@media screen and (min-width:800px){
  .container h1{
    color:red;
  }
  
}

@media screen and (max-width:600px) {
  .container{
    max-width:800px;
  }
  html{
    font-size:.9rem;
  }  
  
}

@media screen and (max-width:400px) {
  
  html{
      font-size:.7rem;
    } 
}

@media screen and (max-width:200px) {
  
  html{
      font-size:.5rem;
    } 
}
              
            
!

JS

              
                
              
            
!
999px

Console