纯CSS 常见3D实例
一、正方体 我认为正方体可以算是3D图像的基础吧,首先正方体是由六个相同的面所组成,其次就需要我们依次构造。(据体构造在代码中) 成平图如下: 代码如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>正方体</title> <style> .d3{ height: 300px; width:300px; perspective: 800px; margin:140px auto; border:1px solid #ccc; } .stage{ height: 300px; width: 300px; transform-style: preserve-3d; position: relative; transform: rotateX(45deg) rotateY(45deg); } .role{ height: 300px; width: 300px; position: absolute; } .stage{ animation: