cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <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>
            
          
!
            
              * { 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;
}
            
          
!
999px
Loading ..................

Console