CSS3 translate3d() method Examples




CSS3 translate3d() method Examples

<!DOCTYPE html>
<html>
   <head>
      <title>CSS3 translate3d() Method</title>
      <style type="text/css">
         .container{
            width: 125px;
            height: 125px;
			   perspective: 500px;
            border: 4px solid #e5a043;
            background: #ccc;
            margin: 30px;
         }
         .transformed {
            -webkit-transform: translate3d(25px, 25px, 50px);
            transform: translate3d(25px, 25px, 50px);
         }
      </style>
   </head>
   <body>
      <h2>Before Translation:</h2>
      <div class="container">
         <img src="css3.jpg" alt="CSS3">
      </div>
      <h2>After Translation:</h2>
      <div class="container">
         <img src="css3.jpg" class="transformed" alt="CSS3">
      </div>
   </body>
</html>

Output