首页 > 其他 > 详细

8.31学习笔记

时间:2018-08-31 11:17:06      阅读:197      评论:0      收藏:0      [点我收藏+]

复习3d立方体

实例:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
body{
perspective: 2000px;
}
@-webkit-keyframes zhuan{
from{transform: rotateX(0) rotateY(0);}
to{transform: rotateX(360deg) rotateY(360deg);}
}
.box{
width: 400px;
height: 400px;
margin: 100px auto;
position: relative;
transform-style: preserve-3d;
animation: zhuan 3s linear infinite;
}
.box>div{
width: 400px;
height: 400px;
border: 1px solid pink;
position: absolute;
left:0;
top: 0;
text-align: center;
line-height:400px ;
}
.box>div:nth-of-type(1){
background: red;
transform: translateZ(200px);
transition: all 2s linear;
}
.box>div:nth-of-type(2){
background: orange;
transform: translateZ(-200px);
transition: all 2s linear;
}
.box>div:nth-of-type(3){
background: paleturquoise;
transform: rotateY(90deg) translateZ(-200px);
transition: all 2s linear;
}
.box>div:nth-of-type(4){
background: green;
transform: rotateY(90deg) translateZ(200px);
transition: all 2s linear;
}
.box>div:nth-of-type(5){
background: palevioletred;
transform: rotateX(90deg) translateZ(-200PX);
transition: all 2s linear;
}
.box>div:nth-of-type(6){
background: purple;
transform: rotateX(90deg) translateZ(200px);
transition: all 2s linear;
}
.box:hover .a1{
transform: translateZ(400px);
}
.box:hover .a2{
transform: translateZ(-400px);
}
.box:hover .a3{
transform: rotateY(90deg) translateZ(-400px);
}
.box:hover .a4{
transform: rotateY(90deg) translateZ(400px);
}
.box:hover .a5{
transform: rotateX(90deg) translateZ(-400PX);
}
.box:hover .a6{
transform: rotateX(90deg) translateZ(400PX);
}
</style>
</head>
<body>
<div class="box">
<div class="a1">1</div>
<div class="a2">2</div>
<div class="a3">3</div>
<div class="a4">4</div>
<div class="a5">5</div>
<div class="a6">6</div>
</div>
</body>
</html>

8.31学习笔记

原文:https://www.cnblogs.com/xieyankeai/p/9564621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!