这个也算得上是JquerySchool网站上一款非常逆天的作品,没有任何javascript或者jquery脚本参考,纯css样式代码实现,兼容所有浏览器,也是从事政府资助工作的网友杰立把收藏已久的作品整理出来分享的,非常实用,使用非常简单,既可当导航菜单使用,也可以当树型菜单使用,太棒了。。。
核心css样式代码如下:
.nav { border: 0; border-left: 1px solid #BBBBBB; }
.nav ul li li {color: #000; background: url("../images/line.gif") left center no-repeat;}
.nav ul ul ul {border-left: 1px solid #BBBBBB; }
.nav ul li .sub-sub {background: url("../images/line.gif") top left no-repeat;}
.nav a, .nav a:visited {color: #4F4F4F;}
.nav a:active, .nav a:hover, .nav a:focus, a:focus .sffocus {color: #000;}
.nav ul ul a, .nav ul ul a:visited {color: #4F4F4F;}
.nav ul ul a:active, .nav ul ul a:hover, .nav ul ul a:focus {color: #000;}
/* inner box styling */
/* Level 1 */
.nav ul li .ro {display: block; width: 100%; background: url("../images/ro-01.gif") top right no-repeat;}
.nav ul li .lo {display: block; width: 100%; background: url("../images/lo-01.gif") top left no-repeat;}
.nav ul li .ru {display: block; width: 100%; background: url("../images/ru-01.gif") bottom right no-repeat;}
.nav ul li .lu {display: block; width: 100%; background: url("../images/lu-01.gif") bottom left no-repeat;}
.nav ul li .box-content {width: 100%; padding: 0.1em 0.1em 0.1em 0.1em; }
/* Level 2 + 3 */
.nav ul li li .ro {background: url("../images/ro-02.gif") top right no-repeat;}
.nav ul li li .lo {background: url("../images/lo-02.gif") top left no-repeat;}
.nav ul li li .ru {background: url("../images/ru-02.gif") bottom right no-repeat;}
.nav ul li li .lu {background: url("../images/lu-02.gif") bottom left no-repeat;}
.nav ul li li .box-content {width: 100%; padding: 0.1em 0.1em 0.1em 0.1em; }
/* Level 1 - 3 hover */
.nav ul li a:hover .ro {background: url("../images/ro_h.gif") top right no-repeat;}
.nav ul li a:hover .lo {background: url("../images/lo_h.gif") top left no-repeat;}
.nav ul li a:hover .ru {background: url("../images/ru_h.gif") bottom right no-repeat;}
.nav ul li a:hover .lu {background: url("../images/lu_h.gif") bottom left no-repeat;}
效果如下:
如果您觉得本作品对您的学习有所帮助:
关键字:
网友杰立 导航菜单 二级菜单 树形菜单 dtree sitemap 网站地图