backface-visibility-2-ref.html 739 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <style>
  5. #container {
  6. position: relative;
  7. margin: 10px auto;
  8. width: 450px;
  9. height: 281px;
  10. z-index: 1;
  11. -moz-perspective: 1000px;
  12. }
  13. #card {
  14. width: 100%;
  15. height: 100%;
  16. -moz-transform-style: preserve-3d;
  17. -moz-transform: rotateY(165deg);
  18. }
  19. .face {
  20. position: absolute;
  21. width: 100%;
  22. height: 100%;
  23. -moz-backface-visibility: hidden;
  24. background: red;
  25. }
  26. .face.back {
  27. display: block;
  28. -moz-transform: rotateY(180deg);
  29. box-sizing: border-box;
  30. padding: 10px;
  31. color: white;
  32. text-align: center;
  33. background: green;
  34. }
  35. </style>
  36. <div id="container" class="hover">
  37. <div id="card">
  38. <div class="back face">
  39. </div>
  40. </div>
  41. </div>
  42. </body></html>