黑松山资源网 Design By www.paidiu.com
今天给大家分享一款纯css实现的漂亮导航。之前为大家分享过jquery实现的个人中心导航菜单,今天这款也是适合放在个人中心。还带来图标,效果不错。一起看下效果图:
实现的代码。
html代码:
XML/HTML Code复制内容到剪贴板- <div class="l-main">
- <div class="menu">
- <header class="menu__header">
- <h1 class="menu__header-title">
- Incoming Messages</h1>
- </header>
- <div class="menu__body">
- <ul class="nav">
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link is-active">
- <i class="fa fa-envelope nav__item-icon"></i><span class="nav__item-text">News</span>
- <span class="badge badge--warning">32</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-flag nav__item-icon">
- </i><span class="nav__item-text">Priority</span> <span class="badge">8</span> </a>
- </li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-space-shuttle nav__item-icon">
- </i><span class="nav__item-text">Assigned</span> <span class="badge">0/17</span> </a>
- </li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-archive nav__item-icon">
- </i><span class="nav__item-text">Archived</span> <span class="badge">3</span> </a>
- </li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-trash nav__item-icon">
- </i><span class="nav__item-text">Deleted</span> <span class="badge">9</span> </a>
- </li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><span class="nav__item-text">
- Show all</span> </a></li>
- </ul>
- </div>
- </div>
- <div class="menu menu--small">
- <header class="menu__header">
- <h1 class="menu__header-title">
- Incoming</h1>
- </header>
- <div class="menu__body">
- <ul class="nav">
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link is-active"><i class="fa fa-envelope nav__item-icon">
- </i><span class="badge badge--warning">32</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-flag nav__item-icon">
- </i><span class="badge">8</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-space-shuttle nav__item-icon">
- </i><span class="badge">0/17</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-archive nav__item-icon">
- </i><span class="badge">3</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><i class="fa fa-trash nav__item-icon">
- </i><span class="badge">9</span> </a></li>
- <li class="nav__item"><a href="https://www.jb51.net" class="nav__item-link"><span class="nav__item-text">
- Show all</span> </a></li>
- </ul>
- </div>
- </div>
- </div>
css代码:
CSS Code复制内容到剪贴板- body
- {
- background: #F4F4F4;
- font-family: Arial, sans-serif;
- font-size: 14px;
- font-weight: lighter;
- }
- .l-main
- {
- width: 530px;
- margin: 0 auto;
- }
- .menu
- {
- width: 250px;
- margin: 40px;
- background: #fff;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
- border-radius: 5px;
- float: left;
- }
- .menu__header
- {
- background: #4B4F55;
- border-bottom: 1px solid #353A40;
- border-radius: 5px 5px 0 0;
- }
- .menu__header-title
- {
- color: #fff;
- padding: 15px;
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
- }
- .menu__body
- {
- border-radius: 0 0 5px 5px;
- }
- .menu--small
- {
- width: 110px;
- }
- .nav
- {
- list-style: none;
- }
- .nav__item
- {
- position: relative;
- }
- .nav__item-link
- {
- padding: 10px 15px;
- text-decoration: none;
- color: #8B8E93;
- display: block;
- border-bottom: 1px solid #F0F0F0;
- }
- .nav__item-link:hover
- {
- background: #f0f0f0;
- }
- .nav__item-link.is-active
- {
- background: #6E757F;
- color: #fff;
- border-bottom-color: #4B4F55;
- box-shadow: 0 1px 0 #7A828D inset;
- }
- .nav__item-link.is-active:after
- {
- content: '';
- display: block;
- position: absolute;
- top: 50%;
- rightright: -6px;
- margin-top: -6px;
- border-top: 6px solid transparent;
- border-bottom: 6px solid transparent;
- border-left: 6px solid #6E757F;
- }
- .nav__item-link.is-active .nav__item-icon
- {
- color: #fff;
- }
- .nav__item:last-child .nav__item-link
- {
- border-bottom: none;
- }
- .nav__item-icon
- {
- color: #D2D5DA;
- width: 20px;
- text-align: center;
- font-size: 18px;
- margin-right: 10px;
- }
- .badge
- {
- font-size: 12px;
- padding: 2px 8px;
- border: 1px solid #D1D1D1;
- border-radius: 10px;
- position: absolute;
- top: 10px;
- rightright: 15px;
- }
- .badge--warning
- {
- background: #ED373F;
- border-color: #ED373F;
- }
以上就是今天分享的一款纯css实现的漂亮导航。谢谢阅读,希望能帮到大家,请继续关注,我们会努力分享更多优秀的文章。
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 张真.1993-失恋十四行【上华】【WAV+CUE】
- 钟明秋《爱有天意HQCD》[低速原抓WAV+CUE]
- 孙云岗唢呐《金声玉振[HIFI珍藏版]》[低速原抓WAV+CUE]
- 谭艳精讯TEST-CD试音39号》2CD[DTS-WAV]
- 姚璎格《发烧女中音》DSD版[低速原抓WAV+CUE][1G]
- 张玮伽《微风细雨DSD》发烧大碟[WAV+CUE][1.1G]
- 群星《2024好听新歌14》十倍音质 U盘音乐 [WAV分轨][966M]
- s14全球总决赛T1战队队员都有谁 LOLs14全球总决赛T1战队介绍
- 英雄联盟faker身价有10亿吗 英雄联盟faker身价介绍一览
- faker大魔王称号怎么来的 faker大魔王称号来源介绍
- PS5 Pro上的蒂法更美了!博主盛赞新机1000%值得购买
- 腾讯互娱再离职一员大将!或因供应商贪腐
- Ayaneo3游戏掌机预热:旗舰定位、造型圆润自带底键
- 动力火车.1999-背叛情歌【上华】【WAV+CUE】
- 刘力扬.2019-Neon.Lit虹【摩登天空】【FLAC分轨】