cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <svg style="position: absolute; width: 0; height: 0;" width="0" height="0">
    <symbol id="heart" viewBox="0 0 1024 1024" fill="aliceblue">
        <title>heart</title>
        <path class="path1" d="M755.188 64c-107.63 0-200.258 87.554-243.164 179-42.938-91.444-135.578-179-243.216-179-148.382 0-268.808 120.44-268.808 268.832 0 301.846 304.5 380.994 512.022 679.418 196.154-296.576 511.978-387.206 511.978-679.418 0-148.392-120.43-268.832-268.812-268.832z"></path>
    </symbol>
</svg>

<body>

<div class="card effect__hover">

  <div class="card__wrapper">
    
    <input type="checkbox" checked>
    
    <div class="card__side card__side__top">
<p>Click on the card to cut it in half!<p></div> 
    <div class="card__back">
    <div class="card__stick">
      <p>Now click me to reattach!<p>
      </div> 
    <div class="card__drop"></div> 
    </div>
    <div class="card__side card__side__bottom">
                <svg class="heart">
                    <use xlink:href="#heart"></use>
                </svg>
    </div> 
    
  </div> 

</div> 
</body>
            
          
!
            
              @import url("https://fonts.googleapis.com/css?family=Roboto");

$card-width: 25vw;
$card-height: $card-width*1.4;
$color-1: midnightblue;
$color-2: darkblue;
$color-3: aliceblue;
$color-4: white;
body {
  background-color: $color-4;
}
 p {
  font-size: 1.75em;
  font-family: 'Roboto', sans- serif;
}  
.card {
  position: relative;
  float: left;
  width: $card-width;
  height: $card-height;
  margin: 20px;
  background-color: $color-4;
  /*border: 1px solid $color-3;*/
  border-radius: 9px;
  /*box-shadow: 9px 9px 9px #888888;*/
  margin: 0 auto;
  overflow: hidden;
  
  &__wrapper {
    width: $card-width;
    height: $card-height;
    
    input[type=checkbox] {
      position: absolute;
      cursor: pointer;
      width: $card-width;
      height: $card-height;
      z-index: 100;
      opacity: 0;
      top: 0;
      left: 0;
      
      &:checked {
        
        &~div.card__side__top {
          transform: translateX(0);
        }
        
        &~div.card__side__bottom {
          transform: translateX(0);
        }
      }
    }
  }
  
  &__side {
    display: flex;
    align-items: center;
    background: $color-1;
    text-align: center;
    color: $color-3;
    float: left;
    position: relative;
    width: $card-width;
    transition: all 0.25s linear;
    z-index: 3;
    &__top {
      text-align: center;
      justify-content: flex-end;
      transform: translateY(-100%);
      height: $card-height/2;
    }
    &__bottom {
      justify-content: flex-start;
      transform: translateY(100%);
      height: $card-height/2;
    }
  }
  
  &__back {
    background: $color-1;
    color: $color-3;
    position: absolute;
    text-align: center;
    z-index: 2;
    width: $card-width;
  }
    .card__stick {
      background-color: $color-1;
      height: $card-height/2;
    }
    .card__drop {
      background-color: $color-4;
      height: $card-height/2;
    }
}
            
          
!
999px
Loading ..................

Console