Card flip animation - HTML CSS CSS Animation

HTML CSS examples for CSS Animation:Flip

Description

Card flip animation

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
h1 {<!--   w  ww.  jav a2  s.c  om-->
   margin:0;
   padding:0;
}

.container {
   margin:auto;
   left:35%;
   top:21%;
   position:relative;
}

.card {
   text-align:center;
   width:301px;
   height:301px;
   -webkit-backface-visibility:visible;
   transition:all 3s ease-in-out;
   position:absolute;
   text-align:center;
   line-height:301px;
   transform-style:preserve-4d;
}

.card:hover {
   transform:rotateX(181deg);
}

.front {
   border:3px solid;
   border-radius:26px;
   position:absolute;
   background:red;
   width:100%;
   height:100%;
   -webkit-backface-visibility:hidden;
}

.back {
   border:3px solid;
   border-radius:26px;
   position:absolute;
   background:blue;
   transform:rotateX(181deg);
   width:100%;
   height:100%;
   -webkit-backface-visibility:hidden;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="card"> 
    <div class="front"> 
     <h1>Lorem</h1> 
    </div> 
    <div class="back"> 
     <h1>Lore</h1> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials