温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

css制作正方体

发布时间:2020-05-29 23:58:59 来源:亿速云 阅读:223 作者:鸽子 栏目:web开发

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="index.css">
<style>
html,body{
height: 100%;
}
.main{
width: 300px;
height: 300px;
/ background-color: green; /
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
transform-style: preserve-3d;
/ transition: 20s; /
/ transform: rotateX(-35deg) rotateY(45deg) ; /
transform: rotateX(-15deg) rotateY(60deg) ;
}
.box{
position: absolute;
top: 0;
left: 0;
width: 298px;
height: 298px;
background: rgba(255,192,203,0.6);
border: 1px solid #ffffff;
float: left;
font: 100px/298px '黑体';
color: #fff;
text-align: center;
}
.box:nth-child(1){
transform: translateZ(150px);
}
.box:nth-child(2){
transform: rotateY(90deg) translateZ(150px);
}
.box:nth-child(3){
transform: rotateY(-90deg) translateZ(150px);
}
.box:nth-child(4){
transform: rotateX(90deg) translateZ(150px);
}
.box:nth-child(5){
transform: rotateX(-90deg) translateZ(150px);
}
.box:nth-child(6){
transform: translateZ(-150px);
}
</style>
</head>
<body>
<div class="main">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
<div class="box">6</div>
</div>

</body>
</html>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI