Css33D旋转正方体实现(一)

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			section{
				width: 400px;
				height: 400px;
				background: url(img/1.jpg) no-repeat;
				background-size: 100% 100%;
				position: fixed;
				margin: auto;
				left: 0;right: 0;
				top: 0;bottom: 0;
				transform-style: preserve-3d;
				transform: rotateX(20deg) rotateY(30deg);
			}
			div{
				width: 400px;
				height: 400px;
				text-align: center;
				line-height: 400px;
				font-size: 100px;
				color: #fff;
				font-weight: 900;
				position: absolute;
				/* 透明 */
				opacity: 0.6;
			}
			div:nth-child(1){
				background: red;
				transform: translateZ(200px);
			}
			div:nth-child(2){
				background: blue;
				transform: translateZ(-200px) rotateY(180deg);
			}
			div:nth-child(3){
				background: pink;
				transform: translateY(-200px) rotateX(90deg);
			}
			div:nth-child(4){
				background: orange;
				transform: translateY(200px) rotateX(-90deg);
			}
			div:nth-child(5){
				background: yellow;
				transform: translateX(-200px) rotateY(-90deg);
			}
			div:nth-child(6){
				background: purple;
				transform: translateX(200px) rotateY(90deg);
			}
			
			section:hover{
				transform: rotateX(20deg) rotateY(30deg) scaleZ(2);
			}
		</style>
	</head>
	<body>
		<section>
			<div>1</div>
			<div>2</div>
			<div>3</div>
			<div>4</div>
			<div>5</div>
			<div>6</div>
		</section>
	</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值