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

              
                <div class="container">
  <h1 class="center-block text-center">Hover the boxes</h1>
<div class="row home-masonry-set">
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="http://cdn.movieweb.com/img.news.tops/NEjUjharIzSkms_1_a.jpg" alt="" />
    <article>
    
      <h3>Poe Dameron</h3>
    <p>As the conflict with the First Order grew more desperate, Dameron was sent to find Lor San Tekka on Jakku. </p>
      
    </article>
  </div>  
  <!-- Item End -->
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="http://img.cinemablend.com/quill/d/5/5/5/3/0/d55530b24267ed6266fff1fe92b83cf545075957.jpg" alt="" />
    <article>
    
      <h3>Jyn Erso</h3>
    <p>After being abandoned by the Partisans, Erso spent several years on her own, committing a number of crimes in order to survive in a dangerous galaxy. </p>
      
    </article>
  </div>
  <!-- Item End -->
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="https://i.dailymail.co.uk/i/pix/2014/12/01/2393A37C00000578-2856268-image-22_1417452851369.jpg" alt="" />
    <article>
    
      <h3>Rey</h3>
    <p>After being abandoned by the Partisans, Erso spent several years on her own, committing a number of crimes in order to survive in a dangerous galaxy.</p>
    
    </article>
    
  </div>  
  <!-- Item End -->
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="https://4.bp.blogspot.com/-44k48fjvmlk/UBN9_I7zX9I/AAAAAAAADBQ/PZo8NQ8SdKw/s1600/Jake_Lloyd5.jpg" alt="" />
    <article>
    
      <h3>Anakin Skywalker</h3>
    <p>In the years leading up to the devastating, galaxy-wide conflict known as the Clone Wars, Skywalker was apprenticed to Obi-Wan Kenobi. </p>
      
    </article>
  </div>  
  <!-- Item End -->
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="https://68.media.tumblr.com/tumblr_mb3im7V82d1qzsy70o1_1280.jpg" alt="" />
    <article>
    
      <h3>Padmé Amidala</h3>
    <p>Amidala was elected Queen of Naboo at the age of fourteen, soon after which she was forced to contend with the Trade Federation occupation. </p>
      
    </article>
  </div>
  <!-- Item End -->
  
  <!-- Item Start -->
  <div class="item col-md-4">
    <img src="https://s-media-cache-ak0.pinimg.com/originals/a0/fa/e2/a0fae2eebea5cb5ae2de49f132f346a2.jpg" alt="" />
    <article>
    
      <h3>Obi-Wan Kenobi</h3>
    <p>He was mentor to both Anakin Skywalker and his son, Luke, training them in the ways of the Force.</p>
    
    </article>
    
  </div>  
  <!-- Item End -->
  
</div>  
</div>
              
            
!

CSS

              
                *,
*:before,
*:after {
  box-sizing: border-box !important;
}

body {
  background-color: #242423;
  color: #fff;
}

.container {
  margin-top: 1%;
  margin-bottom: 3%;
}
h1 { padding: 1em; }

.home-masonry-set .item {
  display: inline-block;
  text-align: center;
  overflow: hidden;
  max-height: 16em;
  min-height: 16em;
  position: relative;
  float: left;
  padding-right: 0;
  padding-left: 0;
}

.home-masonry-set .item article {
  display: block;
  opacity: 0;
  height: 100%;
  padding: 60px 50px;
  position: relative;
  transition: all .5s ease;
}

.home-masonry-set > .item img {
  display: block;
  object-fit: cover;
  position: absolute;
  top: 0%;
  left: 0%;
  min-height: 16em;
  width: 100%;
  z-index: 0;
}

.home-masonry-set > div:hover {
  cursor: pointer;
}

.home-masonry-set > div:hover article {
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

.home-masonry-set > div h3 {
  margin-top: 0px;
}

.home-masonry-set > div p {
  text-align: justify;
}
              
            
!

JS

              
                
              
            
!
999px

Console