1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| <html lang="en">
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>css3 简单的立方体</title> <style type="text/css"> .box { width: 100px; height: 100px; background-color: tomato; opacity: 0.8; border-radius: 3px; box-shadow: 1px 1px 2px #000000; text-shadow: 1px 1px 2px #ffffff; }
.box { transform: translate(100px, 50px); transform: scale(1.5, 0.5); transform: rotate(45deg); transform: skew(20deg); }
.cube>.top { width: 240px; height: 60px; background-color: #dddddd; transform: skew(-45deg, 0) translate(30px, 0); }
.cube>.center { width: 240px; height: 240px; background-color: #aaaaaa; display: inline-block; }
.cube>.right { width: 60px; height: 240px; background-color: #888888; display: inline-block; transform: skew(0, -45deg) translate(0, -30px); } </style> </head>
<body> <div class="cube"> <div class="top"></div> <div class="center"></div><div class="right"></div> </div> </body>
</html>
|