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

              
                <section id="posts">
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/animals);"><h2>A title of a page here</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/arch);"><h2>This post has a title</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/nature);"><h2>Another title on a post</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/people);"><h2>Posts are better with titles</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/tech);"><h2>Some titles are better than others</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/grayscale);"><h2>Titles can be long</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/sepia);"><h2>Short titles are a thing too</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/animals);"><h2>As long as they look different</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/tech);"><h2>Lorem ipsum sucks</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/animals);"><h2>A title of a page here</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/arch);"><h2>This post has a title</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/nature);"><h2>Another title on a post</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/people);"><h2>Posts are better with titles</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/tech);"><h2>Some titles are better than others</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/grayscale);"><h2>Titles can be long</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/sepia);"><h2>Short titles are a thing too</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/animals);"><h2>As long as they look different</h2><p class="lead">By Author name</p></a>
  <a href="#" title="A title of a page here" class="post" style="background-image: url(https://placeimg.com/640/480/tech);"><h2>Lorem ipsum sucks</h2><p class="lead">By Author name</p></a>
</section>































<!-- Jay's Viewport Helper -->
<div style="position:fixed;top:0;left:0;background-color:rgba(0,0,0,0.5);padding:10px;color:#fff;">
  <span class="hidden-sm-up">SIZE XS</span>
  <span class="hidden-xs-down hidden-md-up">SIZE SM</span>
  <span class="hidden-sm-down hidden-lg-up">SIZE MD</span>
  <span class="hidden-md-down hidden-xl-up">SIZE LG</span>
  <span class="hidden-lg-down">SIZE XL</span>
</div>
<!-- /Jay's Viewport Helper -->
              
            
!

CSS

              
                body {background-color:#000;}
#posts {
  text-align: center;
  font-size: 0;
}
#posts .post {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 0;
  border: 3px solid #000;
  display: inline-block;
  background-size: cover;
  background-position: center center;
  transition: all 300ms ease-out;
}
#posts .post h2 {
  color:#fff;
  position: absolute;
  bottom: 80px;
  margin: 0;
  font-size: 2vw;
  line-height: 0.8;
  font-family: 'MuseoSansRounded-900', 'Arial Black', sans-serif;
  padding: 0 60px;
  text-transform: uppercase;
  text-align: left;
  z-index: 1000;
}
#posts .post p {
  color:#fff;
  position: absolute;
  bottom: 40px;
  margin: 0;
  font-size: 1.5vw;
  line-height: 0.8;
  padding: 0 60px;
  text-transform: capitalize;
  text-align: left;
  z-index: 1000;
}
#posts .post:before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  opacity: 0.5;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
  filter: alpha(opacity=50);
  transition: all 300ms ease-out;
  content: '';
  z-index: 1;
}
#posts .post:hover:before {
  opacity: 0.2;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(opacity=20);
  filter: alpha(opacity=20);
}



/* === MEDIA QUERIES === */

/* MOBILE FIRST */
/* XS */ 
/* SM */ @media (min-width: 34em) {#posts .post {width:50%;}}
/* MD */ @media (min-width: 48em) {#posts .post {width:25%;}}
/* LG */ @media (min-width: 62em) {#posts .post {width:33.33333333%;}}
/* XL */ @media (min-width: 75em) {#posts .post {width:25%;}}

              
            
!

JS

              
                
              
            
!
999px

Console