一款純css3實(shí)現(xiàn)的豎形二級(jí)導(dǎo)航的實(shí)例教程
發(fā)布時(shí)間:2014-12-11 09:43:29 作者:佚名
我要評(píng)論

這篇文章主要為大家介紹了一款純css3實(shí)現(xiàn)的豎形二級(jí)導(dǎo)航的實(shí)例教程,這款導(dǎo)航菜單特色是可以是無(wú)限級(jí)。下面有代碼,不會(huì)的朋友可以過(guò)來(lái)借鑒學(xué)習(xí)哦
之前為大家分享了好多導(dǎo)航菜單。今天給大家?guī)?lái)一款純css3實(shí)現(xiàn)的豎形二級(jí)導(dǎo)航。這款導(dǎo)航菜單可以是無(wú)限級(jí)。一起看下效果圖:
實(shí)現(xiàn)的代碼。
html代碼:
XML/HTML Code復(fù)制內(nèi)容到剪貼板
- <div style="width: 700px; margin: auto;">
- <div class="W1-h16">
- <ul>
- <li class="has-sub"><a href="#">Menu 1</a>
- <ul>
- <li class="has-sub"><a href="#">Submenu 1.1</a>
- <ul>
- <li><a href="#">Submenu 1.1.1</a></li>
- <li class="has-sub"><a href="#">Submenu 1.1.2</a>
- <ul>
- <li><a href="#">Submenu 1.1.2.1</a></li>
- <li><a href="#">Submenu 1.1.2.2</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#">Submenu 1.2</a></li>
- </ul>
- </li>
- <li class="has-sub"><a href="#">Menu 2</a>
- <ul>
- <li><a href="#">Submenu 2.1</a></li>
- <li><a href="#">Submenu 2.2</a></li>
- </ul>
- </li>
- <li class="has-sub"><a href="#">Menu 3</a>
- <ul>
- <li><a href="#">Submenu 3.1</a></li>
- <li><a href="#">Submenu 3.2</a></li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
css3代碼:
CSS Code復(fù)制內(nèi)容到剪貼板
- .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;
- }
相關(guān)推薦:
一款純css3實(shí)現(xiàn)的環(huán)形導(dǎo)航菜單
一款基于jquery和css3的響應(yīng)式二級(jí)導(dǎo)航菜單
一款簡(jiǎn)潔的純css3代碼實(shí)現(xiàn)的動(dòng)畫導(dǎo)航
相關(guān)文章
純CSS+XHTML實(shí)現(xiàn)的二級(jí)導(dǎo)航菜單效果
這篇文章主要為大家介紹了純CSS+XHTML實(shí)現(xiàn)的二級(jí)導(dǎo)航菜單效果,通過(guò)簡(jiǎn)單的鼠標(biāo)事件操作頁(yè)面元素樣式變換實(shí)現(xiàn)二級(jí)導(dǎo)航菜單的功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2015-09-25純CSS實(shí)現(xiàn)超簡(jiǎn)單的二級(jí)下拉導(dǎo)航菜單代碼
這篇文章主要為大家介紹了純CSS實(shí)現(xiàn)超簡(jiǎn)單的二級(jí)下拉導(dǎo)航菜單代碼,涉及css針對(duì)hover樣式設(shè)置的相關(guān)技巧,非常簡(jiǎn)單實(shí)用,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-15實(shí)列教程 一款基于jquery和css3的響應(yīng)式二級(jí)導(dǎo)航菜單
之前分享了很多純css的導(dǎo)航菜單,今天介紹一款基于jquery和css3的響應(yīng)式二級(jí)導(dǎo)航菜單,這款導(dǎo)航是傳統(tǒng)的基于頂部,鼠標(biāo)經(jīng)過(guò)的時(shí)候顯示二級(jí)導(dǎo)航,還采用了當(dāng)前流行的響應(yīng)式2014-11-13一款純css實(shí)現(xiàn)的漂亮導(dǎo)航菜單(也適用于個(gè)人中心)
之前已經(jīng)分享很多css3實(shí)現(xiàn)的導(dǎo)航菜單,今天再分享一款純css實(shí)現(xiàn)的漂亮導(dǎo)航,這款也是適合放在個(gè)人中心。還帶來(lái)圖標(biāo),效果不錯(cuò)。需要的朋友可以參考下2014-11-07簡(jiǎn)單的二級(jí)菜單導(dǎo)航實(shí)現(xiàn)css代碼
這種效果在b2c商城經(jīng)常用的到,項(xiàng)目剛結(jié)束簡(jiǎn)單分享下,感興趣的朋友可以參考下,希望可以幫助到你2013-05-02- 這篇文章主要介紹了CSS3 二級(jí)導(dǎo)航的制作的示例的相關(guān)資料,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-04-02