老师 我这个写的有什么需要改进的吗 谢谢
来源:2-12 空间移动
慕仙0240544
2022-07-02 21:19:19
<!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;
}
div{
width: 200px;
height: 200px;
position: relative;
perspective: 200px;
margin: 100px auto;
}
p {
width: 200px;
height: 200px;
position: absolute;
}
/* 外 */
div p:nth-child(1){
background-color: rgba(51,21,31,0.6);
transform: translateZ(100px);
}
/* 里 */
div p:nth-child(2){
background-color: rgba(21,31,41,0.7);
transform: rotateX(180deg) translateZ(100px);
}
/* 左 */
div p:nth-child(3){
background-color: rgba(42,52,14,1);
transform: rotateY(90deg) translateZ(100px);
}
div p:nth-child(4){
background-color: rgba(77,21,81,1);
transform: rotateY(-90deg) translateZ(100px);
}
div p:nth-child(5){
background-color: rgba(211,211,211,1);
transform: rotateX(90deg) translateZ(100px);
}
div p:nth-child(6){
background-color: rgba(231,31,171,1);
transform:rotateX(-90deg) translateZ(100px);
}
</style>
</head>
<body>
<div>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</div>
</body>
</html>
1回答
好帮手慕星星
2022-07-02
同学你好,代码没问题,不需要修改。祝学习愉快~
相似问题
回答 1
回答 1