3d-导航栏制作(导航栏上下翻转)

嗯。。。将前段时间学的CSS   3d-翻转的导航栏代码传上来吧。


<!DOCTYPE html>
<html>
<head>
	<title>
		翻转导航栏
	</title>
	<meta charset="utf-8">
	<style type="text/css">
	body{
		margin: 0px;
		padding: 0px;
	}
	nav{
		width: 980px;
		margin: 50px auto;
		background-color: #efefef;
		
	}
	nav:after{
		display: block;
		clear:both;
		overflow: hidden;
		content: "";
	}
	nav .item{
		width: 200px;
		height: 100px;
		margin-right: 5px;
		float: left;
		perspective: 6000px;
	}
	nav .item a{
		display: block;
		height: 100px;
		text-decoration: none;
		transition: all .5s; 
		transform-style: preserve-3d;
	}
	nav .item a p{
		height: 100px;
		margin: 0;
		line-height: 100px;
		font-size: 20px;
		font-family: "Microsoft Yahei";
		text-align: center;
		color: #fff;
		border-radius:2px;
		transition: all .5s;
	}
	nav .item a p:first-child{
		background-color: orange;
		transform: translateZ(50px) ;
	}
	nav .item a p:last-child{
		background-color: #1571fa;
		transform: translateZ(50px) rotateX(-90deg);
		margin-top: -50px;
	}
	nav .item a:hover{
		transform: rotateX(90deg);
	}
	nav .item a:hover p:last-child{
		margin-top: 0px;
		transform: translateZ(0px) rotateX(-90deg);
	}
	</style>
	
</head>
<body>
	<nav class="dh">
	<div class="item">
		<a href="#" >
			<p>Home</p>
			<p>首页</p>
		</a>
	</div>
	<div class="item">
		<a href="#" >
			<p>Content</p>
			<p>目录</p>
		</a>
	</div>
	<div class="item">
		<a href="#" >
			<p>About Us</p>
			<p>关于我们</p>
		</a>
	</div>
	</nav>

</body>
</html>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值