opacity-preserve3d-2.html 546 B

1234567891011121314151617181920212223242526272829303132
  1. <!DOCTYPE html>
  2. <html><head>
  3. <style>
  4. .first {
  5. transform: translateZ(10px);
  6. background-color: blue;
  7. top: 50px;
  8. }
  9. .second {
  10. transform: translateZ(5px);
  11. background-color: green;
  12. }
  13. .preserve {
  14. transform-style: preserve-3d;
  15. }
  16. .leaf {
  17. width: 100px;
  18. height: 100px;
  19. position:absolute;
  20. }
  21. </style>
  22. </head><body>
  23. <div class="preserve" style="opacity:0.5">
  24. <div class="leaf first"></div>
  25. <div class="leaf second"></div>
  26. </div>
  27. </body>
  28. </html>