栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > Html/CSS > CSS教程

一款纯css实现的漂亮导航菜单(也适用于个人中心)

CSS教程 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

  今天给大家分享一款纯css实现的漂亮导航。之前为大家分享过jquery实现的个人中心导航菜单,今天这款也是适合放在个人中心。还带来图标,效果不错。一起看下效果图:

  实现的代码。

  html代码:

XML/HTML Code复制内容到剪贴板
  1.   
  2.           
  3.               
  4.                   
  5.                     Incoming Messages  
  6.               
  7.               
  8.                   
  9.                       
  10.                         News  
  11.                         32 
  12.   
  13.                       
  14.                     Priority 8   
  15.                     
  16.   
  17.                       
  18.                     Assigned 0/17   
  19.                     
  20.   
  21.                       
  22.                     Archived 3   
  23.                     
  24.   
  25.                       
  26.                     Deleted 9   
  27.                     
  28.   
  29.                       
  30.                         Show all 
  31.   
  32.                   
  33.             
  
  •         
  •   
  •           
  •               
  •                   
  •                     Incoming  
  •               
  •               
  •                   
  •                       
  •                     32 
  •   
  •                       
  •                     8 
  •   
  •                       
  •                     0/17 
  •   
  •                       
  •                     3 
  •   
  •                       
  •                     9 
  •   
  •                       
  •                         Show all 
  •   
  •                   
  •             
  •   
  •         
  •   
  •       
  •   css代码:

    CSS Code复制内容到剪贴板
    1. body   
    2.         {   
    3.             background: #F4F4F4;   
    4.             font-family: Arial, sans-serif;   
    5.             font-size: 14px;   
    6.             font-weight: lighter;   
    7.         }   
    8.            
    9.         .l-main   
    10.         {   
    11.             width: 530px;   
    12.             margin: 0 auto;   
    13.         }   
    14.            
    15.         .menu   
    16.         {   
    17.             width: 250px;   
    18.             margin: 40px;   
    19.             background: #fff;   
    20.             box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);   
    21.             border-radius: 5px;   
    22.             float: left;   
    23.         }   
    24.            
    25.         .menu__header   
    26.         {   
    27.             background: #4B4F55;   
    28.             border-bottom: 1px solid #353A40;   
    29.             border-radius: 5px 5px 0 0;   
    30.         }   
    31.            
    32.         .menu__header-title   
    33.         {   
    34.             color: #fff;   
    35.             padding: 15px;   
    36.             text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);   
    37.         }   
    38.            
    39.         .menu__body   
    40.         {   
    41.             border-radius: 0 0 5px 5px;   
    42.         }   
    43.            
    44.         .menu--small  
    45.         {   
    46.             width: 110px;   
    47.         }   
    48.            
    49.         .nav   
    50.         {   
    51.             list-style: none;   
    52.         }   
    53.            
    54.         .nav__item   
    55.         {   
    56.             position: relative;   
    57.         }   
    58.            
    59.         .nav__item-link   
    60.         {   
    61.             padding: 10px 15px;   
    62.             text-decoration: none;   
    63.             color: #8B8E93;   
    64.             display: block;   
    65.             border-bottom: 1px solid #F0F0F0;   
    66.         }   
    67.         .nav__item-link:hover   
    68.         {   
    69.             background: #f0f0f0;   
    70.         }   
    71.         .nav__item-link.is-active   
    72.         {   
    73.             background: #6E757F;   
    74.             color: #fff;   
    75.             border-bottom-color: #4B4F55;   
    76.             box-shadow: 0 1px 0 #7A828D inset;   
    77.         }   
    78.         .nav__item-link.is-active:after   
    79.         {   
    80.             content: '';   
    81.             display: block;   
    82.             position: absolute;   
    83.             top: 50%;   
    84.             rightright: -6px;   
    85.             margin-top: -6px;   
    86.             border-top: 6px solid transparent;   
    87.             border-bottom: 6px solid transparent;   
    88.             border-left: 6px solid #6E757F;   
    89.         }   
    90.         .nav__item-link.is-active .nav__item-icon  
    91.         {   
    92.             color: #fff;   
    93.         }   
    94.         .nav__item:last-child .nav__item-link   
    95.         {   
    96.             border-bottom: none;   
    97.         }   
    98.            
    99.         .nav__item-icon  
    100.         {   
    101.             color: #D2D5DA;   
    102.             width: 20px;   
    103.             text-align: center;   
    104.             font-size: 18px;   
    105.             margin-right: 10px;   
    106.         }   
    107.            
    108.         .badge   
    109.         {   
    110.             font-size: 12px;   
    111.             padding: 2px 8px;   
    112.             border: 1px solid #D1D1D1;   
    113.             border-radius: 10px;   
    114.             position: absolute;   
    115.             top: 10px;   
    116.             rightright: 15px;   
    117.         }   
    118.            
    119.         .badge--warning   
    120.         {   
    121.             background: #ED373F;   
    122.             border-color: #ED373F;   
    123.         }  

      以上就是今天分享的一款纯css实现的漂亮导航。谢谢阅读,希望能帮到大家,请继续关注考高分网,我们会努力分享更多优秀的文章。

    转载请注明:文章转载自 www.mshxw.com
    本文地址:https://www.mshxw.com/it/216557.html

    CSS教程相关栏目本月热门文章

    我们一直用心在做
    关于我们 文章归档 网站地图 联系我们

    版权所有 (c)2021-2022 MSHXW.COM

    ICP备案号:晋ICP备2021003244-6号