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

              
                <div class="events">
  <a href="#" class="event" style="background-image:url('http://www.lorempixel.com/600/600/people')">
    <div class="shadowbox">
      <h3>Beer and Cheese Tasting Event</h3>
      <p><strong>Date: </strong>May 28 @ 8:00 pm</p>
      <p>Come eat some delicious cheese and drink even more delicious beer with us!</p>
    </div>
  </a>
  <a href="#" class="event" style="background-image:url('http://www.lorempixel.com/600/600/abstract')">
    <div class="shadowbox">
      <h3>Cheesecake Extraordinaire!</h3>
      <p><strong>Date: </strong>June 18 @ 4:00 pm</p>
      <p>Come eat some cheesecake and try our Belgain Trippel pairings!</p>
    </div>
  </a>
  <a href="#" class="event" style="background-image:url('http://www.lorempixel.com/600/500/people')">
    <div class="shadowbox">
      <h3>4’th of Ju Luau</h3>
      <p><strong>Date: </strong>July 4 @ 5:00 pm</p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta dolore sit magnam, eveniet id aperia</p>
    </div>
  </a>
  <a href="#" class="event" style="background-image:url('http://www.lorempixel.com/800/500/abstract')">
    <div class="shadowbox">
      <h3>Free Beer Tasting</h3>
      <p><strong>Date: </strong>July 24 @ 8:00 pm</p>
      <p>Come one, come all and try our newest beer. &nbsp;Free!</p>
    </div>
  </a>
  <a href="#" class="event" style="background-image:url('http://www.lorempixel.com/600/600/cats')">
    <div class="shadowbox">
      <h3>Kegs and Eggs</h3>
      <p><strong>Date: </strong>March 12, 2017</p>
      <p>An annual Saint Patrick’s Day celebration held in Albany, NY. There are two ways one can go ab</p>
    </div>
  </a>
</div>
              
            
!

CSS

              
                * {
  transition: all .125s ease-in-out;
}

a {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  text-decoration: none;
}

h3 {
  font-family: sans-serif;
  margin-bottom: 20px;
}

.events {
  display: flex;
  flex-wrap: wrap;
}

.events .shadowbox {
  height: 400px;
  padding-top: 0;
  background: rgba(0, 0, 0, 0.5);
}

.event {
  text-align: center;
  margin-bottom: 200px;
  min-width: 100px;
  background-repeat: no-repeat;
}

.event h3 {
  padding-top: 50px;
}

.event {
  background-size: cover;
  background-position: center;
  height: 400px;
  flex-grow: 1; // This is what makes everything magically grow and shrink.
  margin-bottom: 50px;
  flex-basis: 0;
  text-align: center;
  margin-bottom: 200px;
  min-width: 100px;
  background-repeat: no-repeat;
}

.event:hover {
  flex-grow: 2; // On-hover the item will grow to double the width, shrinking the rest automatically
}

.events .shadowbox:hover {
    background: rgba(0, 0, 0, 0.3);
}

.event h3,
.event a,
.event p {
  color: white;
  width: 90%;
  margin: auto;
}

.event:not(:first-of-type) {
  border-left: 3px solid white;
}


/*
I usually use
@media (orientation: portrait) and (max-device-width: 775px)

For this, but for the sake of display, I changed it to a query that changes without mobile emulation.
*/

@media only screen and (max-width: 775px) {
  .event:last-of-type {
    margin-bottom: 30px;
  }
  .event:hover {
    flex-grow: 1; //Disables the growth behavior on-mobile
  }
  .event:nth-of-type(1) {
    min-width: 100%; //Forces the first element to be full-width
  }
  .event {
    min-width: 300px;
    margin-bottom: 3px;
  }
}
              
            
!

JS

              
                /*
Nothing to see here ;)
*/
              
            
!
999px

Console