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

              
                <header class="siteHeader">
  <h1>Boxes</h1>
</header>
<main class="boxes">
  <section class="box box1">
    <h1>box1</h1>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus, explicabo.</p>
  </section>
  <section class="box box2">
    <h1>box2</h1>
    <p>Quod iure tempora cupiditate laboriosam, recusandae ab nemo id adipisci. Lorem ipsum dolor sit amet consectetur adipisicing.</p>
  </section>
  <section class="box box3">
    <h1>box3</h1>
    <p>Eos nostrum quia laborum molestiae autem rerum ad eius error?</p>
  </section>
  <section class="box box4">
    <h1>box4</h1>
    <p>Quo doloremque corporis ipsam iure saepe et, debitis quos natus!</p>
  </section>
  <section class="box box5">
    <h1>box5</h1>
    <p>Minus praesentium consequatur quos, quasi aliquam ipsa necessitatibus quisquam repellat!</p>
  </section>
  <section class="box box6">
    <h1>box6</h1>
    <p>Laboriosam recusandae ullam eligendi eveniet doloremque aperiam molestias sint officiis?</p>
  </section>
  <section class="box box7">
    <h1>box7</h1>
    <p>Porro pariatur, consectetur quas laboriosam autem qui numquam minus sint!</p>
  </section>
  <section class="box box8">
    <h1>box8</h1>
    <p>Esse non ipsam provident quod earum corporis ex voluptas ratione.</p>
  </section>
  <section class="box box9">
    <h1>box9</h1>
    <p>Ratione officiis fuga eaque tenetur. Quisquam beatae vel perferendis doloremque.</p>
  </section>
  <section class="box box10">
    <h1>box10</h1>
    <p>Quod nihil ducimus repellat aperiam recusandae, ut dolores in cupiditate.</p>
  </section>
</main>

<aside class="centered-content extra-info">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officiis vero voluptatibus non qui assumenda quae facere, id tempore nam? Dicta.</p>
</aside>

<footer class="pageFooter">
  <p>Page Footer. Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic, libero!</p>
</footer>
              
            
!

CSS

              
                body{
  display:grid;
  grid-template-columns: 1fr 12rem;
  grid-template-rows:auto-fit max-content 8rem;
  grid-template-areas: "header header"
    "main sidebar"
    "footer footer";
  grid-gap:1rem;
}
.siteHeader{
  grid-area: header;
}
main.boxes{
  grid-area: main;
}
aside{
  grid-area: sidebar;
}
.siteFooter{
  grid-area: footer;
}

h1{
  font-family: "Times New Roman",serif;
  font-size: 3rem;
}
.box h1{
  font-size: 2rem;
}
.box{
  background-color: orange;
}

/* .box{
  float: left;
  width: 33%;
} */
.box4, .box7{
/*   clear:left; */
}
/* .boxes :nth-child(3n+4){
  clear:left;
} */

/* .boxes{
  display: flex;
  flex-wrap:wrap;
}
.box{
  width: 33%;
} */

.boxes{
  display:grid;
  grid-template-columns: 1fr;
/*   grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); */
  grid-gap:1rem;
}
@media (min-width: 600px){
  .boxes{
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 800px){
  .boxes{
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 1000px){
  .boxes{
    grid-template-columns:  1fr 1fr 1fr 1fr;
  }
  .box h1{
    font-size:5rem;
  }
}

.box{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  align-items: center;
}

.centered-content{
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  align-items: center;
}

.extra-info{
  background-color: #999;
  border: 3px solid #333;
  padding: 1rem;
}

.box.box2{
  background-color: green;
  grid-column: span 2;
}
.box.box9{
  grid-column: span 2;
}
h1{
  font-size: 5rem;
}

              
            
!

JS

              
                
              
            
!
999px

Console