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. 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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <main role="main">
 <section class="container card-grid">
  <figure>
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496761/mis/mis-homepage/2kids-reading.jpg" alt="two kids reading a book">
   <figcaption>
    <h4>Year 3 Students</h4>
    <blockquote>
     <p>Spends more of their free time in the Library. Lorem ipsum dolor sit, amet consectetur adipisicing elit.</p>
    </blockquote>
    <a class="btn btn-info" href="#">Read More</a>
   </figcaption>
  </figure>
  <div class="card-event">
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496765/mis/mis-homepage/football.jpg" alt="">
   <div class="event-date">
    <div>SEP</div>
    <p>17</p>
    <div>MON</div>
   </div>
   <div class="event-description">
    <h2>Under 11 Mixed</h2>
    <h3>Football Match</h3>
    <p>ISC vs MIS<br> (venue <strong>@ISC</strong>)</p>
   </div>
  </div>

  <figure>
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496829/mis/mis-homepage/Mr-Mark.jpg" alt="School Principal's speech on the stage">
   <figcaption>
    <h4>Principal's Graduation Speech</h4>
    <blockquote>
     <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Architecto assumenda fugiat enim natus labore neque ipsa numquam temporibus quam fuga, eaque atque dolores dolorem officiis.</p>
    </blockquote>
    <a class="btn btn-info" href="#">Read More</a>
   </figcaption>
  </figure>

  <figure>
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496791/mis/mis-homepage/library.jpg" alt="Teacher reading a book to his student">
   <figcaption>
    <h4>Journey of a Future Bookworm</h4>
    <blockquote>
     <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Architecto assumenda fugiat enim natus labore neque ipsa numquam temporibus quam fuga, eaque atque dolores dolorem officiis.</p>
    </blockquote>
    <a class="btn btn-info" href="#">Read More</a>
   </figcaption>
  </figure>

  <div class="card-event">
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496765/mis/mis-homepage/football.jpg" alt="">
   <div class="event-date">
    <div>SEP</div>
    <p>18</p>
    <div>TUE</div>
   </div>
   <div class="event-description">
    <h2>Under 13 Boys</h2>
    <h3>Football Match</h3>
    <p>St. Andrews vs MIS<br> (venue <strong>@MIS</strong>)</p>
   </div>
  </div>

  <figure>
   <img src="https://res.cloudinary.com/imgursoyjean/image/upload/v1537496800/mis/mis-homepage/Mr-Craig.jpg" alt="Mr. Craig Jenkins storytelling to the students">
   <figcaption>
    <h4>Mr. Craig's Charismatic Storytelling</h4>
    <blockquote>
     <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Architecto assumenda fugiat enim natus labore neque ipsa numquam temporibus quam fuga, eaque atque dolores dolorem officiis.</p>
    </blockquote>
    <a class="btn btn-info" href="#">Read More</a>
   </figcaption>
  </figure>
 </section>

</main>
              
            
!

CSS

              
                $crete: #477f2d;

.card-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
 grid-auto-rows: minmax(250px, 1fr);
 grid-auto-flow: dense;
 grid-gap: 5px;
 padding: 5px;
 figure {
  margin: 0;
  // border: 2px solid grey;
  position: relative;

  img {
   position: absolute;
   height: 100%;
   width: 100%;
   // z-index: -1;
   object-fit: cover;
  }

  figcaption {
   position: absolute;
   height: 75px;
   left: 15px;
   right: 15px;
   bottom: 15px;
   background: rgba(71, 127, 45, 0.75);
   padding: 15px;
   color: white;
   overflow: hidden;
   // text-overflow: ellipsis;

   blockquote {
    height: 60px;
    overflow: hidden;
   }
  }
 }

 @media only screen and (min-width: 576px) {
  > :nth-child(4) {
   grid-row: span 2;
  }
  > :last-child {
   grid-column: span 2;
  }
 }

 .card-event {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-around;
  // border: 2px solid yellow;
  color: white;
  background: rgba(0, 0, 0, 0.5);

  img {
   position: absolute;
   height: 100%;
   width: 100%;
   z-index: -1;
   object-fit: cover;
  }

  .event-date {
   text-align: center;
   height: 120px;

   > :nth-child(2) {
    font-size: 2em;
    border-left: 7px solid $crete;
    border-right: 7px solid $crete;
    margin: 0;
    height: 50px;
    background: white;
    color: $crete;
   }

   > :nth-child(odd) {
    height: 28px;
    background: $crete;
   }
  }

  .event-description {
   text-align: center;

   > :nth-child(1n + 0) {
    padding: 0;
    margin: 0;
   }
  }
 }
}

              
            
!

JS

              
                
              
            
!
999px

Console