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

              
                <main class="E R">
  <article>
     <h1>One</h1>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/10558/manwithacamera.jpg" alt="test image" />
      <p> Nullam <span>pellentesquenec</span> bibendum hendrerit augue, sed tempus odio sagittis nec. Ut ipsum lorem, scelerisque ac vestibulum et, tincidunt eget urna. Phasellus  urna id elementum. Maecenas a urna metus. Vivamus ac euismod ante. Vivamus ut risus porttitor, porttitor ligula a, maximus risus. Donec maximus vulputate mauris, vel placerat diam interdum.</p>
  </article>

    <article>
     <h1>Two</h1>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/10558/manwithacamera.jpg" alt="test image" />
      <p> Nullam <span>pellentesquenec</span> bibendum hendrerit augue, sed tempus odio sagittis nec. Ut ipsum lorem, scelerisque ac vestibulum et, tincidunt eget urna. Phasellus  urna id elementum. Maecenas a urna metus. Vivamus ac euismod ante. Vivamus ut risus porttitor, porttitor ligula a, maximus risus. Donec maximus vulputate mauris, vel placerat diam interdum.</p>
  </article>
  
    <article>
     <h1>Three</h1>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/10558/manwithacamera.jpg" alt="test image" />
      <p> Nullam <span>pellentesquenec</span> bibendum hendrerit augue, sed tempus odio sagittis nec. Ut ipsum lorem, scelerisque ac vestibulum et, tincidunt eget urna. Phasellus  urna id elementum. Maecenas a urna metus. Vivamus ac euismod ante. Vivamus ut risus porttitor, porttitor ligula a, maximus risus. Donec maximus vulputate mauris, vel placerat diam interdum.</p>
  </article>
  
    <article>
     <h1>Four</h1>
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/10558/manwithacamera.jpg" alt="test image" />
      <p> Nullam <span>pellentesquenec</span> bibendum hendrerit augue, sed tempus odio sagittis nec. Ut ipsum lorem, scelerisque ac vestibulum et, tincidunt eget urna. Phasellus  urna id elementum. Maecenas a urna metus. Vivamus ac euismod ante. Vivamus ut risus porttitor, porttitor ligula a, maximus risus. Donec maximus vulputate mauris, vel placerat diam interdum.</p>
  </article>
  
  <footer></footer>
  <footer></footer>
  <footer></footer>
  <footer></footer>
</main>
              
            
!

CSS

              
                * { box-sizing: border-box; } 
h1, p, img { border: solid 8px #c429c4; }
main { border: solid 8px #20a0ca; font-family: "Avenir Next"; margin: 2rem; }
article { border: solid 8px #ffb53e; }
h1 { font-family: "Avenir Next Condensed"; font-weight: 200; font-size: 2rem; line-height: 1.1; margin: 0.5em 0 0.44em; }
h2 { text-align:center; margin-top: 0; }
img {
  width: 100%;
  height: 50vh; 
  object-fit: cover;
  object-position: 50% 40%;
}
main {
  display: grid;
  grid-gap: 0 2rem;
}
main.A {
  grid-template-columns: 1fr 1fr 1fr 1fr;
  footer:nth-of-type(1)::after { content: '1fr'; }
  footer:nth-of-type(2)::after { content: '1fr'; }
  footer:nth-of-type(3)::after { content: '1fr'; }
  footer:nth-of-type(4)::after { content: '1fr'; }
}
main.B {
  grid-template-columns: 1fr 2fr 4fr 6fr;
  footer:nth-of-type(1)::after { content: '1fr'; }
  footer:nth-of-type(2)::after { content: '2fr'; }
  footer:nth-of-type(3)::after { content: '4fr'; }
  footer:nth-of-type(4)::after { content: '6fr'; }
  span { background: yellow; }
}

main.C {
  grid-template-columns: 1fr 1fr minmax(250px, 600px) 1fr;
  footer:nth-of-type(1)::after { content: '1fr'; }
  footer:nth-of-type(2)::after { content: '1fr'; }
  footer:nth-of-type(3)::after { content: 'minmax(250px, 600px)'; }
  footer:nth-of-type(4)::after { content: '1fr'; }
}

main.D {
  grid-template-columns: 200px 1fr minmax(300px, 600px) 1fr;
  footer:nth-of-type(1)::after { content: '200px'; }
  footer:nth-of-type(2)::after { content: '1fr'; }
  footer:nth-of-type(3)::after { content: 'minmax(300px, 600px)'; }
  footer:nth-of-type(4)::after { content: '1fr'; }
}

main.E {
  grid-template-columns: 200px auto minmax(300px, 600px) 1fr;
  footer:nth-of-type(1)::after { content: '200px'; }
  footer:nth-of-type(2)::after { content: 'auto'; }
  footer:nth-of-type(3)::after { content: 'minmax(300px, 600px)'; }
  footer:nth-of-type(4)::after { content: '1fr'; }
}


main.R {
  border: none;
  h1, p, img { border: none; }
  article { border: none; }
  footer { ddisplay: none; }
}

footer {
  text-align: center;
  background: black;
  color: yellow;
  padding: 0.2rem;
  font-size: 1.5rem;
  font-weight: bold;
  align-self: center;
}
footer:nth-of-type(1) {
  grid-area: 1 / 1 / 2 / 2;
}
footer:nth-of-type(2) {
  grid-area: 1 / 2 / 2 / 3;
}
footer:nth-of-type(3) {
  grid-area: 1 / 3 / 2 / 4;

}
footer:nth-of-type(4) {
  grid-area: 1 / 4 / 2 / 5;
}
              
            
!

JS

              
                
              
            
!
999px

Console