源代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>魔方</title>
<link rel="icon" href="./img/logo_32.ico">
<style>
html{
background-color: black;
height: 100%;
}
/* 最外层容器样式 */
.wrap{
width: 200px;
height: 200px;
/* background-color: blue; */
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
border-radius: 50%;
}
/* 包裹所有容器的样式 */
.cube{
width: 200px;
height: 200px;
margin: 0 auto;
/* 使容器内所有元素具有3d空间效果 */
transform-style: preserve-3d;
animation: rotate 20s infinite;
animation-timing-function: linear;
border-radius: 50%;
}
@keyframes rotate{
form{
transform: rotateX(0deg) rotateY