1. <!DOCTYPE html>
    2. <html>
    3. <head lang="en">
    4. <meta charset="UTF-8">
    5. <title>椭圆</title>
    6. <style>
    7. * {
    8. margin: 0;
    9. padding: 0;
    10. }
    11. .wrapper {
    12. width: 400px;
    13. height: 400px;
    14. margin: 200px;
    15. perspective: 800px;
    16. perspective-origin: 50% 50%;
    17. position: relative;
    18. }
    19. .stage {
    20. transform-style: preserve-3d;
    21. position: absolute;
    22. top: 50%;
    23. left: 50%;
    24. transform: translate3d(-50%, -50%, 0);
    25. }
    26. .ball {
    27. width: 200px;
    28. height: 200px;
    29. border-radius: 50%;
    30. background-color: #ccc;
    31. position: absolute;
    32. top: 50%;
    33. left: 50%;
    34. transform: translate3d(-50%, -50%, 0);
    35. box-shadow: 0px 55px 45px -38px rgba(0, 0, 0, .3);
    36. }
    37. .ball::before {
    38. content: "";
    39. position: absolute;
    40. top: 1%;
    41. left: 5%;
    42. width: 90%;
    43. height: 90%;
    44. border-radius: 50%;
    45. background: -webkit-radial-gradient(50% 0px, circle, #ffffff, rgba(255, 255, 255, 0) 58%);
    46. z-index: 2;
    47. }
    48. .text {
    49. width: 100px;
    50. height: 50px;
    51. line-height: 50px;
    52. text-align: center;
    53. white-space: nowrap;
    54. animation: rotate 5s linear infinite;
    55. backface-visibility: hidden;
    56. }
    57. @keyframes rotate {
    58. from {
    59. transform: rotateY(0deg) translateZ(100px);
    60. }
    61. to {
    62. transform: rotateY(360deg) translateZ(100px);
    63. }
    64. }
    65. </style>
    66. </head>
    67. <body>
    68. <div class="wrapper">
    69. <div class="ball"></div>
    70. <div class="stage">
    71. <div class="text">
    72. 这里是文字
    73. </div>
    74. </div>
    75. </div>
    76. </body>
    77. </html>