div+css实现7种导航条菜单弹出方式动画效果代码
代码语言:html
所属分类:菜单导航
代码描述:div+css实现7种导航条菜单弹出方式动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
background: #4481AA;
color: #fff;
font: normal 300 16px/1.5 "Open Sans", sans-serif;
}
.container {
position: fixed;
z-index: 2;
width: 100%;
min-height: 100%;
padding: 30px 50px;
background: #4481AA;
-webkit-transition: -webkit-transform 0.5s;
-webkit-backface-visibility: hidden;
}
.containerOverlay {
display:none;
background: rgba(0,0,0,.3);
}
.containerOverlay,
.containerOverlay a {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
/* Type and Buttons */
h1 {
font-weight: 300;
}
.button {
display: block;
float: left;
clear: left;
margin-bottom: 16px;
padding: 0 10px;
background: #2A6791;
color: #fff;
border-bottom: 2px solid #154464;
border-radius: 2px;
text-decoration: none;
line-height: 40px;
}
/* Nav */
nav {
position: fixed;
top: 0;
bottom: 0;
-webkit-transform: translate3d(-100%, 0, 0);
-webkit-transition: -webkit-transform 0.5s;
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
width: 30%;
background: #2A6791;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;;
}
nav li {
display: block;
padding: 10px 20px;
border-bottom: 1px solid #225679;
}
nav:target {
z-index: 3;
-webkit-transform: translate3d(0, 0, 0);
}
nav:target ~ .container .containerOverlay {
display: block;
}
/* Push left */
#pushLeft:target ~ .container {
-webkit-transform: translate3d(30%, 0, 0);
}
/* Push top */
#pushTop {
bottom: auto;
width: 100%;
height: 45px;
-webkit-transform: translate3d(0, -100%, 0);
}
#pushTop li {
float: left;
padding: 0 16px;
line-height: 45px;
border: 0;
border-right: 1px solid #225679;
}
#pushTop:target {
-webkit-transform: translate3d(0, 0, 0);
}
#pushTop:target ~ .container {
-webkit-transform: translate3d(0, 45px, 0);
}
/* Rotate in top to left */
#rotateTopLeft {
z-index: 4;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0