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

              
                .wrapper
  article.story
    .story__media
       a.story__link(src="#")
         img.story__featured-image(src='https://source.unsplash.com/pmX9BkDDr_A')
         .story__taxonomy hiking
    header
      h2.story__title Get Outside
    .story__body
      p Virtutis, magnitudinis animi, patientiae, fortitudinis fomentis dolor mitigari solet. An vero, inquit, quisquam potest probare, quod perceptfum, quod. Apparet statim, quae sint officia, quae actiones. Quorum altera prosunt, nocent altera. Nos paucis ad haec additis finem faciamus aliquando; Vitiosum est enim in dividendo partem in genere numerare. Omnia contraria, quos etiam insanos esse vultis. Quodcumque in mentem incideret, et quodcumque tamquam occurreret. 
    
      p Bonum valitudo: miser morbus. Cum autem in quo sapienter dicimus, id a primo rectissime dicitur. Quodcumque in mentem incideret, et quodcumque tamquam occurreret. Omnium enim rerum principia parva sunt, sed suis progressionibus usa augentur nec sine causa; Cum salvum esse flentes sui respondissent.   
    a.btn.read-more(href="#") Read More

  article.story
    .story__media
      a.story__link(src="#")
        img.story__featured-image(src='https://source.unsplash.com/MAxHEAaAukI')
        .story__taxonomy hiking
    header
      h2.story__title Winter Wonderland
    .story__body
      p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sin te auctoritas commovebat, nobisne omnibus et Platoni ipsi nescio quem illum anteponebas? Miserum hominem! Si dolor summum malum est, dici aliter non potest. Eadem nunc mea adversum te oratio est. Dat enim intervalla et relaxat. Duo Reges: constructio interrete.
    
      p Tum ille timide vel potius verecunde: Facio, inquit. Non risu potius quam oratione eiciendum? Similiter sensus, cum accessit ad naturam, tuetur illam quidem, sed etiam se tuetur; Optime, inquam. Nihil enim iam habes, quod ad corpus referas. Quodcumque in mentem incideret, et quodcumque tamquam occurreret. Quodcumque in mentem incideret, et quodcumque tamquam occurreret.
    a.btn.read-more(href="#") Read More

  article.story
    .story__media
      a.story__link(src="#")
        img.story__featured-image(src='https://source.unsplash.com/Z87YuMKEiWk')
        .story__taxonomy snowshoeing
    header
      h2.story__title The Mountains Beckon
    .story__body
       p Virtutis, magnitudinis animi, patientiae, fortitudinis fomentis dolor mitigari solet. An vero, inquit, quisquam potest probare, quod perceptfum, quod. Apparet statim, quae sint officia, quae actiones. Quorum altera prosunt, nocent altera. Nos paucis ad haec additis finem faciamus aliquando; Vitiosum est enim in dividendo partem in genere numerare. Omnia contraria, quos etiam insanos esse vultis. 
    
       p Bonum valitudo: miser morbus. Cum autem in quo sapienter dicimus, id a primo rectissime dicitur. Quodcumque in mentem incideret, et quodcumque tamquam occurreret. Omnium enim rerum principia parva sunt, sed suis progressionibus usa augentur nec sine causa; Cum salvum esse flentes sui respondissent.
    a.btn.read-more(href="#") Read More
              
            
!

CSS

              
                /* Best viewed in full-screen mode! */

/* Variables */
$black: #222;
$darkgray: #383737;
$gray: #999;

* {
 box-sizing: border-box;
}

body {
  font-family: 'Source Sans Pro', Arial, sans-serif;
  font-weight: 400;
  font-size: 100%;
  color: $black;
  line-height: 1.35;
  background: $darkgray;
}

h1,
h2,
h3 {
  font-weight: 900;
}

p {
  margin-bottom: 0.3em;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #000;
  text-decoration: none;
  transition: all 0.3s;
  &:hover {
    color: #000;
    text-decoration: none;
  }
}

.btn {
  background: $black;
  color: #fff;
  font-weight: 900;
  padding: 0.5em 0.8em;
  border-radius: 4%;
  display: inline-block;
  transition: all 0.3s;
  &:hover {
    color: #fff;
    background: $gray;
    text-decoration: none;
  }
}

.wrapper {
  max-width: 1400px;
  margin: 1em auto;
  display: flex;
  flex-wrap: wrap;
}

/* Story styles */
.story {
  background: #fff;
  margin: 1em 0.8em;
  flex: 1 1 500px;
  &:hover {
   .story__media:before {
     opacity: 1;
    }
  }
  
  @media only screen and (min-width: 800px) {
    flex: 1 1 300px;
    
    // For vertical alignment of "read more" buttons
    display: flex;
    flex-wrap: wrap;
    & > * {
      flex: 1 1 100%;
    }
  }
   
  @media only screen and (min-width: 1200px) {
    flex: 1 1 200px; 
  }
}

.story__media {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  &:before {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease-in;
  }
}

.story__link {
  display: inline-block;
}

.story__title {
  font-size: 1.4em;
}

.story__taxonomy {
  position: absolute;
  bottom: 7px;
  left: 0;
  text-transform: uppercase;
  color: #fff;
  font-size: 1.1em;
  font-weight: 300;
  padding: 0.4em 0.5em;
  background: $black;
}

.story__body,
.read-more {
  margin: 0 0.8em;
}

.story__body {
  p:last-of-type {
    margin-bottom: 1em;
  }
  @media only screen and (min-width: 800px) {
     min-height: 500px;
  }
  @media only screen and (min-width: 1200px) {
    min-height: 550px;
  }
}

.read-more {
  flex: 0 1 110px;
  align-self: flex-end;
  margin-bottom: 1.5em;
}

.story__title {
  margin: 0.2em 0 0 0.6em;
}
              
            
!

JS

              
                /* Thanks to Wes Bos for his free Flexbox course at https://flexbox.io! */
              
            
!
999px

Console