1、常用词汇
shadow 阴影 珊 dou
box-shadow: ;
因 赛 特
inset 内阴影
思 泼 ruai 的
spread :阴影大小
2、立方体
<!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>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.wrap {
width: 300px;
height: 300px;
margin: 100px auto;
/* 子绝父相 */
position: relative;
/* perspective: 800px; */
/* 创建网页3d空间 */
transform-style: preserve-3d;
transform: rotateX(10deg) rotateY(10deg) rotateZ(10deg);
}
.wrap div {
width: 300px;
height: 300px;
/* border: 1px solid tomato; */
text-align: center;
line-height: 300px;
font-size: 50px;
font-weight: bold;
position: absolute;
top: 0;
left: 0;
opacity: .8;
}
/* 1 前面 */
.wrap div:nth-child(1) {
background-color: tomato;
transform: translateZ(150px);
}
/* 6 后面 */
.wrap div:nth-child(6) {
background-color: blue;
transform: translateZ(-150px) rotateY(180deg);
}
/* 2 上面 */
.wrap div:nth-child(2) {
background-color: purple;
transform: translateY(-150px) rotateX(90deg);
}
/* 3 下面 */
.wrap div:nth-child(3) {
background-color: pink;
transform: translateY(150px) rotateX(-90deg);
}
/* 4 左面 */
.wrap div:nth-child(4) {
background-color: yellowgreen;
transform: translateX(-150px) rotateY(-90deg);
}
/* 5 右面 */
.wrap div:nth-child(5) {
background-color: yellowgreen;
transform: translateX(150px) rotateY(90deg);
}
</style>
</head>
<body>
<div class="wrap">
<div>1 前面</div>
<div>2 上面</div>
<div>3 下面</div>
<div>4 左面</div>
<div>5 右面</div>
<div>6 后面</div>
</div>
</body>
</html>