首页 技术 正文
技术 2022年11月7日
0 收藏 800 点赞 297 浏览 3339 个字

之前为大家介绍了好几款导航菜单,今天再给大家带来一款css3实现的幽灵按钮式的导航菜单。导航界面非常好看。右侧是一个css3实现的动画消息图标。效果图如下:

纯css3实现的幽灵按钮导航

在线预览   源码下载

实现代码:

html代码:

  <header>
<nav>
<a>Home</a> <a>Words</a> <a>Activity</a> <a>Discussion</a> <a>Immersion</a>
</nav>
<button class="notif">
<span class="icon"></span>
</button>
</header>

css3代码:

  * {
margin:;
padding:;
}body {
background: #e9e9e9;
overflow: hidden;
}header {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
background-color: #1CAFF6;
background-color: rgba(32, 166, 231, 0.8);
background-image: -webkit-gradient(linear, left top, left bottom, from(#20A8E9), to(rgba(30, 158, 220, 0.5)));
background-image: -webkit-linear-gradient(top, #20A8E9, rgba(30, 158, 220, 0.5));
background-image: linear-gradient(to bottom, #20A8E9, rgba(30, 158, 220, 0.5));
padding: 0 50px;
}main {
background: white;
height: 100vh;
border-radius: 10px;
margin: 30px 55px;
background: 0 0 25px rgba(0, 0, 0, 0.04);
}nav {
-webkit-box-flex:;
-webkit-flex:;
-ms-flex:;
flex:;
font: 500 15px/20px "museo-sans-rounded", sans-serif;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
overflow: hidden;
padding: 17px 0;
}a {
display: inline-block;
padding: 10px 18px 8px;
margin: 0 2px;
border-radius: 100px;
color: white;
cursor: pointer;
-webkit-animation: nav-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1.1) backwards;
animation: nav-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1.1) backwards;
-webkit-transition: background 0.35s;
transition: background 0.35s;
}
a:hover {
background: #1493D1;
-webkit-transition:;
transition:;
}
a:active {
background: #107aad;
}
a:nth-child(1) {
-webkit-animation-delay: 0.46667s;
animation-delay: 0.46667s;
}
a:nth-child(2) {
-webkit-animation-delay: 0.58333s;
animation-delay: 0.58333s;
}
a:nth-child(3) {
-webkit-animation-delay: 0.7s;
animation-delay: 0.7s;
}
a:nth-child(4) {
-webkit-animation-delay: 0.81667s;
animation-delay: 0.81667s;
}
a:nth-child(5) {
-webkit-animation-delay: 0.93333s;
animation-delay: 0.93333s;
}@-webkit-keyframes nav-in {
from {
-webkit-transform: translate3d(0px, 100px, 0);
transform: translate3d(0px, 100px, 0);
}
}@keyframes nav-in {
from {
-webkit-transform: translate3d(0px, 100px, 0);
transform: translate3d(0px, 100px, 0);
}
}
.notif {
display: inline-block;
border-radius: 50%;
background: #1392D0;
padding: 7px 9px;
width: 40px;
height: 40px;
border:;
cursor: pointer;
-webkit-transition: 0.35s;
transition: 0.35s;
}
.notif:hover {
background: #0e6d9c;
-webkit-transition-duration: 0.0875s;
transition-duration: 0.0875s;
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.notif:active, .notif:focus {
-webkit-transition-duration:;
transition-duration:;
-webkit-transform: scale(1.15);
-ms-transform: scale(1.15);
transform: scale(1.15);
background: #0b577c;
outline:;
}
.notif .icon {
display: inline-block;
width: 22px;
height: 26px;
background-image: url("icon.png");
-webkit-animation: notif 2s cubic-bezier(0.17, 0.67, 0.4, 1.17) infinite;
animation: notif 2s cubic-bezier(0.17, 0.67, 0.4, 1.17) infinite;
-webkit-background-size: 1000px 1000px;
background-size: 1000px 1000px;
background-position: -340px -40px;
}@-webkit-keyframes notif {
10%, 30% {
-webkit-transform: rotate(-25deg);
transform: rotate(-25deg);
}
20%, 40% {
-webkit-transform: rotate(25deg);
transform: rotate(25deg);
}
50%, 100% {
-webkit-transform: none;
transform: none;
}
}@keyframes notif {
10%, 30% {
-webkit-transform: rotate(-25deg);
transform: rotate(-25deg);
}
20%, 40% {
-webkit-transform: rotate(25deg);
transform: rotate(25deg);
}
50%, 100% {
-webkit-transform: none;
transform: none;
}
}
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,104
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,580
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,428
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,200
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,835
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,918