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

              
                <div class="author">
  <p>Inspired by <a target="_blank" href="https://dribbble.com/shots/3116361-Serif-Combos">Spelar</a></p>
</div>

<div class="slick-slider">
  <li>
  <div class="full-card">

    <div class="font-card robotoslab-card">
      <h3 class="font--robotoslab">Roboto Slab</h3>
      <p class="font--roboto">Roboto Slab is a slab serif in the Roboto family. It was designed by Christian Robertson.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Roboto+Slab" class="explore-button">Explore</a>
    </div>

    <div class="font-card roboto-card">
      <h3 class="font--roboto">Roboto</h3>
      <p class="font--roboto">Roboto is a sans-serif typeface family developed for the mobile operating system, Android.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Roboto" class="explore-button">Explore</a>
    </div>

    <div class="font-description">
      <h2 class="font--robotoslab">Roboto Slab<span class="font--roboto">+Roboto</span></h2>
      <p class="font--roboto">Roboto has a dual nature. It has a mechanical skeleton and the forms are largely geometric. At the same time, the font features friendly and open curves.</p>
    </div>

  </div>
  </li>
  
  <li>
    <div class="full-card">

    <div class="font-card lobster-card">
      <h3 class="font--lobster">Lobster</h3>
      <p class="font--cabin">The new OpenType format gives the possibility to have multiple versions of each letter, and that's exactly it does.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Lobster" class="explore-button">Explore</a>
    </div>

    <div class="font-card cabin-card">
      <h3 class="font--cabin">Cabin</h3>
      <p class="font--cabin">The Cabin font family is a humanist sans with 4 weights and true italics. It also features a touch of modernism.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Cabin" class="explore-button">Explore</a>
    </div>

    <div class="font-description">
      <h2 class="font--lobster">Lobster<span class="font--cabin">+Cabin</span></h2>
      <p class="font--cabin">Lobster is bold and beautiful while remaining quite readable, attributes not easily found in other scripts. To complement this strong statement, you don’t want anything that competes for attention. Instead pick something plain and simple like Cabin.</p>
    </div>
      </li>
    
    
    
    <li>
    <div class="full-card">

    <div class="font-card eczar-card">
      <h3 class="font--eczar">Eczar</h3>
      <p class="font--gentium">Eczar was designed to bring liveliness and vigor to multi-script typesetting in Latin and Devanagari.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Eczar" class="explore-button">Explore</a>
    </div>

    <div class="font-card gentium-card">
      <h3 class="font--gentium">Gentium Basic</h3>
      <p class="font--gentium">The Gentium Basic font family is based on the original Gentium design, but with additional weights.</p>
      <a target="_blank" href="https://fonts.google.com/specimen/Gentium+Basic" class="explore-button">Explore</a>
    </div>

    <div class="font-description">
      <h2 class="font--eczar">Eczar<span class="font--gentium">+Gentium Basic</span></h2>
      <p class="font--gentium">Pairing two serif typefaces is often considered bad practice, but this is a case where we can get away with breaking the rules of typography. Eczar and Gentium Basic share an extremely similar structure, yet they are different enough to still contrast with one another.</p>
    </div>
      </li>
  </div>
</div>
              
            
!

CSS

              
                ///////////DECLARE FONTS///////////
.font--robotoslab {
  font-family: 'Roboto Slab', Georgia, serif;
  font-weight: 700;
}

.font--roboto {
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 400;
}

.font--lobster {
  font-family: 'Lobster', cursive;
  font-weight: 400;
}

.font--cabin {
  font-family: 'Cabin', Arial, sans-serif;
  font-weight: 400;
}

.font--eczar {
  font-family: 'Eczar', Georgia, serif;
  font-weight: 700;
}

.font--gentium {
  font-family: 'Gentium Basic', Georgia, serif;
  font-weight: 400;
}

///////////END DECLARE FONTS///////////


* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Roboto', Georgia, sans-serif;
  font-weight: 400;
  overflow: hidden;
}

body {
  background: linear-gradient( to bottom, #EDF1F2, #D5E2F2);
  justify-content: center;
  align-items: center;
  font-size: 14px;
  display: flex;
}

h1 {
  font-size: 3.5em;
  margin: 0;
  font-weight: normal;
}

h2 {
  font-size: 3em;
  margin: 0;
  font-weight: normal;
}

h3 {
  font-size: 2.5em;
  margin: 0;
  font-weight: normal;
}

h4 {
  font-size: 2.125em;
  margin: 0;
  font-weight: normal;
}

h5 {
  font-size: 1.75em;
  margin: 0;
  font-weight: normal;
}

h6 {
  font-size: 1.25em;
  margin: 0;
  font-weight: normal;
}

.author {
  position: absolute;
  bottom: 5px;
  right: 15px;
  color: #999;
  a {
    color: #A1BEE6;
    text-decoration: none;
    &:hover {
      color: #327CCB;
    }
  }
}


.bx-viewport {
  overflow: visible !important;
}

.bx-pager {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.bx-wrapper .bx-pager.bx-default-pager a {
  background: #666;
  text-indent: -9999px;
  display: block;
  width: 15px;
  height: 15px;
  margin: 0 10px;
  outline: 0;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.bx-wrapper .bx-pager.bx-default-pager a:hover,
.bx-wrapper .bx-pager.bx-default-pager a.active {
  background: rgba(0, 0, 0, 0.7);
}

.full-card {
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 60px;
  height: 80vh;
  max-height: 600px;
  background: white;
  width: 90%;
  max-width: 1300px;
  box-shadow: 0 15px 20px -15px rgba(0, 0, 0, 0.3), 0 55px 50px -35px rgba(0, 0, 0, 0.3), 0 85px 60px -25px rgba(0, 0, 0, 0.1);
}

.font-card {
  position: relative;
  width: 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: linear-gradient(45deg, rgba(159, 190, 230, 1) 0%, rgba(223, 234, 238, 1) 100%);
  ;
  padding: 20px 20px;
  color: white;
  margin: 0 15px;
  text-align: center;
  box-shadow: 0 15px 20px -15px rgba(0, 0, 0, 0.3), 0 55px 50px -35px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s, transform 0.3s;
  transition-delay: 0.15s;
  &.hovered-card {
    box-shadow: 0 5px 3px -5px rgba(0, 0, 0, 0.3), 0 2px 8px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
  }
  p {
    line-height: 1.4;
  }
}

.font-description {
  padding: 0 30px;
  margin: 15px;
  width: 44%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  h2 {
    color: rgb(86, 87, 94);
    span {
      color: rgb(210, 210, 210);
    }
  }
  p {
    padding-left: 15px;
    color: #777;
    line-height: 1.8;
    &:before {
      content: "\2014";
      margin-left: -15px;
      margin-right: 4px;
    }
  }
}

.explore-button {
  font-size: 0.9em;
  background: white;
  width: 80%;
  color: #a7a7a7;
  display: inline-block;
  padding: 1em;
  margin-top: 2em;
  border-radius: 5em;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.15em;
  box-shadow: 0 15px 20px -10px rgba(0, 0, 0, 0.3);
  transition: color 0.6s, box-shadow 0.3s, transform 0.3s;
  &:hover {
    box-shadow: 0 3px 5px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
    color: #6f6f6f;
  }
}

@media screen and (max-width: 991px) {
  .full-card {
    height: auto;
    flex-wrap: wrap;
    padding: 30px 60px;
  }
  .font-card {
    width: calc(50% - 30px);
  }
  .font-description {
    width: 100%;
  }
}

////////////////BACKGROUNDS////////////////

.robotoslab-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480286526/Roboto-slab-image_mtwren.jpg) no-repeat center center;
  background-size: cover;
}

.roboto-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480287191/robot-image_iai6lv.jpg) no-repeat center center;
  background-size: cover;
}

.lobster-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480349796/lobster-image_pznrao.jpg) no-repeat center center;
  background-size: cover;
}

.cabin-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480350297/cabin-image_dqxlwi.jpg) no-repeat center center;
  background-size: cover;
}

.eczar-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480522564/turtle-image_nblim1.jpg) no-repeat center center;
  background-size: cover;
}

.gentium-card {
  background: url(https://res.cloudinary.com/dqj168cdc/image/upload/v1480522983/penguin-image_dufrwg.jpg) no-repeat center center;
  background-size: cover;
}

////////////////END BACKGROUNDS///////////////
              
            
!

JS

              
                $(document).ready(function() {
  
  $('.slick-slider').bxSlider({
    minSlides: 1,
    maxSlides: 1,
    controls: false
  });
  
  $( ".explore-button" ).hover(function() {
    $( this ).parent().addClass("hovered-card");
  }, function() {
    $( this ).parent().removeClass("hovered-card");
  }
);
  
});
              
            
!
999px

Console