almost 9 years ago
For making a flip roatation we use CSS3 3D property. Child elements will preserve its 3D position that is specified by Preserve-3d. The nested elements are rendered in 3D space are specified by transform-style property. Here is the example:-
<!DOCTYPE html> <html> <head> <title></title> <style> .container { width: 416px; height: 260px; position: relative; perspective: 800px; } .container:hover #card{ transform: rotateY(180deg); } #card { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; transition: transform 1s; } #card figure { margin: 0; display: block; position: absolute; width: 100%; height: 100%; backface-visibility: hidden; } #card figure img{ max-width: 100%; } #card .front { background: red; } #card .back { background: blue; transform: rotateY( 180deg ); } #card.flipped { transform: rotateY( 180deg ); } </style> </head> <body> <section class="container"> <div id="card"> <figure class="front"><img src="http://www.9freepictures.com/d/file/travel-tours/200910/china-magnificent-scenery-119-2.jpg" alt=""></figure> <figure class="back"><img src="http://cdn.bigbangfish.com/beautiful/beautiful-scenery/beautiful-scenery-9.jpg" alt=""></figure> </div> </section> </body> </html>
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)