css实现悬浮三维3d翻转图标文字菜单效果代码

代码语言:html

所属分类:菜单导航

代码描述:css实现悬浮三维3d翻转图标文字菜单效果代码

代码标签: css 悬浮 三维 翻转 菜单

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
<style>
*,*:before,*:after {
	box-sizing:border-box
}
:after {
	content:""
}
section {
	position:relative;
	left:100px
}
h1 {
	margin:80px 0 10px 0;
	font-size:52px;
	font-family:'Montserrat',sans-serif;
	text-transform:uppercase;
	text-shadow:1px 1px 0 #DC143C,2px 2px 0 #DC143C,3px 3px 0 #DC143C,4px 4px 0 #DC143C
}
h2 {
	font-size:24px
}
body {
	padding:100px 0;
	background:lightblue;
	color:white;
	max-width:640px;
	font-family:'Montserrat',sans-serif;
	font-size:14px;
	line-height:1.4;
	font-smoothing:anti-aliased
}
nav {
	float:left;
	position:relative;
	top:0;
	left:0;
	background:transparent
}
nav ul {
	text-align:center
}
nav ul li {
	position:relative;
	width:70px;
	cursor:pointer;
	background:crimson;
	text-transform:uppercase;
	transition:all .4s ease-out
}
nav ul li:after {
	position:absolute;
	background:white;
	color:crimson;
	top:0;
	left:70px;
	width:70px;
	height:100%;
	opacity:.5;
	transform:perspective(400px) rotateY(90deg);
	transform-origin:0 100%;
	transition:all .4s ease-out
}
nav ul li:nth-child(1):after {
	content:"Home";
	line-height:88px
}
nav ul li:nth-child(2):after {
	content:"About";
	line-height:88px
}
nav ul li:nth-child(3):after {
	content:"Work";
	line-height:85px
}
nav ul li:nth-child(4):after {
	content:"Say hi";
	line-height:70px
}
nav ul li:hover {
	transform:translateX(-70px)
}
nav ul li:hover:after {
	opacity:1;
	transform:perspective(400px) rotateY(0deg) scale(1)
}
nav ul li>div {
	display:inline-block;
	padding:25px 0;
	background:transparent
}
nav ul li div {
	position:relative
}
.roof {
	width:0;
	height:0;
	top:2px;
	border-style:solid;
	border-width:0 21px 15px 21px;
	border-color:transparent transparent #fff transparent
}
.roof-edge {
	position:absolute;
	z-index:20;
	left:-17px;
	top:3px;
	width:0;
	height:0;
	border-style:solid;
	border-width:0 17px 12px 17px;
	border-color:transparent transparent crimson transparent
}
.roof-edge:after {
	position:absolute;
	left:-14.5px;
	top:3px;
	width:0;
	height:0;
	border-style:solid;
	border-width:0 14.5px 10px 14.5px;
	border-color:transparent transparent white transparent
}
.front {
	position:relative;
	top:3px;
	width:28.5px;
	height:20px;
	margin:0 auto;
	background:white
}
.front:after {
	position:absolute;
	background:crimson;
	width:11px;
	height:13px;
	bottom:0;
	left:9px
}
.head {
	width:32px;
	height:35px;
	background:white;
	border-radius:8px
}
.head:after {
	width:4px;
	height:10px;
	background:white;
	position:absolute;
	border-radius:4px 0 0 4px;
	top:21px;
	left:14px;
	transform:rotate(270deg)
}
.eyes {
	width:8px;
	height:5px;
	border-radius:50%;
	position:absolute;
	top:10px;
	left:5px;
	background:crimson
}
.eyes:after {
	width:8px;
	height:5px;
	border-radius:50%;
	position:absolute;
	top:0;
	left:14px;
	background:crimson
}
.beard {
	width:32px;
	height:17px;
	background:crimson;
	border:2px solid white;
	position:absolute;
	bottom:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0