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="container-fluid">
   <h1>Flip cards <span class="text-primary">Bootstrap 4</span></h4>
   <div class="-card-deck card-columns">
      <!-- Wrap two standard cards -->
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img img-fluid" src="http://lorempixel.com/400/200/animals/1" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Rhinoceros</h4>
            </div>
         </div>
         <div class="card">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Rhinoceros description.</p>
            </div>
         </div>
      </figure>
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img" src="http://lorempixel.com/400/200/animals/2" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Gorilla</h4>
            </div>
         </div>
         <div class="card text-white bg-primary">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Gorilla description.</p>
            </div>
         </div>
      </figure>
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img" src="http://lorempixel.com/400/200/animals/3" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Tiger</h4>
            </div>
         </div>
         <div class="card text-white bg-primary">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Tiger long description.</p>
            </div>
         </div>
      </figure>
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img" src="http://lorempixel.com/400/200/animals/4" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Giraffe</h4>
            </div>
         </div>
         <div class="card">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Giraffe description.</p>
            </div>
         </div>
      </figure>
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img img-fluid" src="http://lorempixel.com/400/200/animals/7" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Cat</h4>
            </div>
         </div>
         <div class="card">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Cat description.</p>
            </div>
         </div>
      </figure>
      <figure class="card card-flip">
         <div class="card bg-dark text-white">
            <img class="card-img" src="http://lorempixel.com/400/200/animals/8" alt="">
            <div class="card-img-overlay d-flex justify-content-center align-items-center">
               <h4 class="card-title display-1">Dog</h4>
            </div>
         </div>
         <div class="card text-white bg-primary">
            <div class="card-body d-flex justify-content-center align-items-center">
               <p class="card-text">Dog description.</p>
            </div>
         </div>
      </figure>
   </div>
</div>
              
            
!

CSS

              
                /*
For demo purpose
*/

@import url('https://fonts.googleapis.com/css?family=Roboto|Barrio');

body {
   margin-top: 15px;
   margin-bottom: 15px;
   background: url(http://cdn.backgroundhost.com/backgrounds/subtlepatterns/strange_bullseyes.png);
   font-family: 'Roboto', sans-serif;
   perspective: 1000;
}

h1, h2, h3, h4 {
   font-family: 'Barrio', cursive;
}

.card-title {
  max-width: 100%; 
  font-size: 4vw;
}

.card-img,
.card-img-top,
.card-img-bottom {   
   min-width: 100%;
   height: 38vh;
   min-height: 38vh;
}

.text-white .card-img {
   filter: brightness(75%) saturate(50%);
}


/*
Flip card
*/
.card-flip {

   background: none;
   border: none;
   padding: 0;

   .card {
      backface-visibility: hidden;
      transition: transform 300ms;
      transition-timing-function: linear;
      width: 100%;
      height: 100%;
      margin: 0;  
   }

   .card:first-of-type {
      tranform: rotateY(0deg);
   }

   .card:last-of-type {
      transform: rotateY(180deg);
      // Put this in face with the larger content
      position: absolute;
      top: 0;
      display: flex;
   }

   &:hover {
      .card:first-of-type  {
         transform: rotateY(-180deg);
      }
      .card:last-of-type {
         transform: rotateY(0deg);
      }
   }

}
              
            
!

JS

              
                
              
            
!
999px

Console