登录  /  注册

纯css3实现的幽灵按钮导航_html/css_WEB-ITnose

php中文网
发布: 2016-06-24 11:58:20
原创
927人浏览过

之前为大家介绍了好几款导航菜单,今天再给大家带来一款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: 0;      padding: 0;}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: 1;  -webkit-flex: 1;  -ms-flex: 1;  flex: 1;  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: 0;  transition: 0;}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: 0;  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: 0;  transition-duration: 0;  -webkit-transform: scale(1.15);  -ms-transform: scale(1.15);  transform: scale(1.15);  background: #0b577c;  outline: 0;}.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;  }}
登录后复制

 

智能AI问答
PHP中文网智能助手能迅速回答你的编程问题,提供实时的代码和解决方案,帮助你解决各种难题。不仅如此,它还能提供编程资源和学习指导,帮助你快速提升编程技能。无论你是初学者还是专业人士,AI智能助手都能成为你的可靠助手,助力你在编程领域取得更大的成就。
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号