How To Create Bounce Effect With CSS3 Animation

The basic idea behind how the bounce will start is that when the object drops on the surface the first time, it bounces of the surface and will reach its highest level. Then it gradually reaches a lower point with every bounce, until the object stops bouncing.
  1. <!DOCTYPE html>  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head runat="server">  
  4.     <title>Bounce Demo By DC</title>  
  5.     <style type="text/css">  
  6.         .animated {  
  7.             -webkit-animation-duration: 1s;  
  8.             animation-duration: 1s;  
  9.             -webkit-animation-fill-mode: both;  
  10.             animation-fill-mode: both;  
  11.         }  
  12.         .bounceInUp {  
  13.             -webkit-animation-name: bounceInUp;  
  14.             animation-name: bounceInUp;  
  15.         }  
  16.         .shadow {  
  17.             padding: 15px 15px 15px 40px;  
  18.             top: 100%;  
  19.             width: 300px;  
  20.             margin-top: 20px;  
  21.             background: #ffffff;  
  22.             border: 1px solid #cbcbcb;  
  23.             -moz-border-radius: 5px;  
  24.             -webkit-border-radius: 5px;  
  25.             border-radius: 5px;  
  26.             -moz-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.3);  
  27.             -webkit-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.3);  
  28.             box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.3);  
  29.         }  
  30.   
  31.         @-webkit-keyframes bounceInUp {  
  32.             0% {  
  33.                 opacity: 0;  
  34.                 -webkit-transform: translateY(2000px);  
  35.                 transform: translateY(2000px);  
  36.             }  
  37.         }  
  38.         @keyframes bounceInUp {  
  39.             0% {  
  40.                 opacity: 0;  
  41.                 -webkit-transform: translateY(2000px);  
  42.                 -ms-transform: translateY(2000px);  
  43.                 transform: translateY(2000px);  
  44.             }  
  45.             60% {  
  46.                 opacity: 1;  
  47.                 -webkit-transform: translateY(-30px);  
  48.                 -ms-transform: translateY(-30px);  
  49.                 transform: translateY(-30px);  
  50.             }  
  51.             80% {  
  52.                 -webkit-transform: translateY(10px);  
  53.                 -ms-transform: translateY(10px);  
  54.                 transform: translateY(10px);  
  55.             }  
  56.   
  57.             100% {  
  58.                 -webkit-transform: translateY(0);  
  59.                 -ms-transform: translateY(0);  
  60.                 transform: translateY(0);  
  61.             }  
  62.         }  
  63.     </style>  
  64. </head>  
  65. <body>  
  66.     <form id="form1" runat="server">  
  67.         <div class="bounceInUp animated" style="visibility: visible; animation-name: bounceInUp;">  
  68.             <div class="shadow">  
  69.                 <h1>Deepak Chaudhary</h1>  
  70.                 <img src="http://www.c-sharpcorner.com/App_themes/csharp/images/sitelogo.png" />  
  71.             </div>  
  72.         </div>  
  73.     </form>  
  74. </body>  
  75. </html>