css3实现的竖形二级导航

不言
풀어 주다: 2018-06-26 10:09:14
원래의
1723명이 탐색했습니다.

这篇文章主要为大家介绍了一款纯css3实现的竖形二级导航的实例教程,这款导航菜单特色是可以是无限级。下面有代码,不会的朋友可以过来借鉴学习哦

  之前为大家分享了好多导航菜单。今天给大家带来一款纯css3实现的竖形二级导航。这款导航菜单可以是无限级。一起看下效果图:

  实现的代码。

  html代码:

  css3代码:

.W1-h16 {   
  padding: 0;   
  margin: 0;   
  border: 0;   
  line-height: 1;   
}   
.W1-h16 ul,   
.W1-h16 ul li,   
.W1-h16 ul ul {   
  list-style: none;   
  margin: 0;   
  padding: 0;   
}   
.W1-h16 ul {   
  position: relative;   
  z-index: 500;   
  float: left;   
}   
.W1-h16 ul li {   
  float: left;   
  min-height: 0.05em;   
  line-height: 1em;   
  vertical-align: middle;   
  position: relative;   
}   
.W1-h16 ul li.hover,   
.W1-h16 ul li:hover {   
  position: relative;   
  z-index: 510;   
  cursor: default;   
}   
.W1-h16 ul ul {   
  visibility: hidden;   
  position: absolute;   
  top: 100%;   
  left: 0px;   
  z-index: 520;   
  width: 100%;   
}   
.W1-h16 ul ul li {   
  float: none;   
}   
.W1-h16 ul ul ul {   
  top: 0;   
  rightright: 0;   
}   
.W1-h16 ul li:hover > ul {   
  visibility: visible;   
}   
.W1-h16 ul ul {   
  top: 0;   
  left: 99%;   
}   
.W1-h16 ul li {   
  float: none;   
}   
.W1-h16 ul ul {   
  margin-top: 0.05em;   
}   
.W1-h16 {   
  width: 13em;   
  background: #333333;   
  font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif;   
  zoom: 1;   
}   
.W1-h16:before {   
  content: '';   
  display: block;   
}   
.W1-h16:after {   
  content: '';   
  display: table;   
  clear: both;   
}   
.W1-h16 a {   
  display: block;   
  padding: 1em 1.3em;   
  color: #ffffff;   
  text-decoration: none;   
  text-transform: uppercase;   
}   
.W1-h16 > ul {   
  width: 13em;   
}   
.W1-h16 ul ul {   
  width: 13em;   
}   
.W1-h16 > ul > li > a {   
  border-right: 0.3em solid #1b9bff;   
  color: #ffffff;   
}   
.W1-h16 > ul > li > a:hover {   
  color: #ffffff;   
}   
.W1-h16 > ul > li a:hover,   
.W1-h16 > ul > li:hover a {   
  background: #1b9bff;   
}   
.W1-h16 li {   
  position: relative;   
}   
.W1-h16 ul li.has-sub > a:after {   
  content: '»';   
  position: absolute;   
  rightright: 1em;   
}   
.W1-h16 ul ul li.first {   
  -webkit-border-radius: 0 3px 0 0;   
  -moz-border-radius: 0 3px 0 0;   
  border-radius: 0 3px 0 0;   
}   
.W1-h16 ul ul li.last {   
  -webkit-border-radius: 0 0 3px 0;   
  -moz-border-radius: 0 0 3px 0;   
  border-radius: 0 0 3px 0;   
  border-bottom: 0;   
}   
.W1-h16 ul ul {   
  -webkit-border-radius: 0 3px 3px 0;   
  -moz-border-radius: 0 3px 3px 0;   
  border-radius: 0 3px 3px 0;   
}   
.W1-h16 ul ul {   
  border: 1px solid #0082e7;   
}   
.W1-h16 ul ul a {   
  color: #ffffff;   
}   
.W1-h16 ul ul a:hover {   
  color: #ffffff;   
}   
.W1-h16 ul ul li {   
  border-bottom: 1px solid #0082e7;   
}   
.W1-h16 ul ul li:hover > a {   
  background: #4eb1ff;   
  color: #ffffff;   
}   
.W1-h16.align-rightright > ul > li > a {   
  border-left: 0.3em solid #1b9bff;   
  border-right: none;   
}   
.W1-h16.align-rightright {   
  float: rightright;   
}   
.W1-h16.align-rightright li {   
  text-align: rightright;   
}   
.W1-h16.align-rightright ul li.has-sub > a:before {   
  content: '+';   
  position: absolute;   
  top: 50%;   
  left: 15px;   
  margin-top: -6px;   
}   
.W1-h16.align-rightright ul li.has-sub > a:after {   
  content: none;   
}   
.W1-h16.align-rightright ul ul {   
  visibility: hidden;   
  position: absolute;   
  top: 0;   
  left: -100%;   
  z-index: 598;   
  width: 100%;   
}   
.W1-h16.align-rightright ul ul li.first {   
  -webkit-border-radius: 3px 0 0 0;   
  -moz-border-radius: 3px 0 0 0;   
  border-radius: 3px 0 0 0;   
}   
.W1-h16.align-rightright ul ul li.last {   
  -webkit-border-radius: 0 0 0 3px;   
  -moz-border-radius: 0 0 0 3px;   
  border-radius: 0 0 0 3px;   
}   
.W1-h16.align-rightright ul ul {   
  -webkit-border-radius: 3px 0 0 3px;   
  -moz-border-radius: 3px 0 0 3px;   
  border-radius: 3px 0 0 3px;   
}
로그인 후 복사

以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!

相关推荐:

使用 css3 实现圆形进度条的方法

利用CSS3来匹配横屏竖屏的方法

如何利用CSS3实现3D翻书效果

위 내용은 css3实现的竖形二级导航의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
저자별 최신 기사
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!