U声U色
- UID42720
- 粉丝1
- 关注0
- 发帖数1
- 铜币12枚
- 威望12点
- 贡献0点
|
楼主#
更多
发布于:2013-12-24 17:57
[tr][td] 下拉菜单如果不需要兼容IE6的话,完全可以不依赖于任何js脚本实现,今天这个案例也是有关于CSS下拉菜单,但有别于以往的,主要区别是子菜单是固定 显示在那,而不是默认隐藏,鼠标悬浮显示的那种,另外还通过CSS3添加了一个滑动块的效果,以前这种滑动块效果也是需要js来实现,今天看到的是没有使 用任何脚本代码,感兴趣的不仿一看。
图片:093733grbtsn7g7gnt6ggg.jpg HTML CODE
[*]Home [*]About Us [*] Services
[*]Design Integration [*]Web Templates [*]Design creations [*]Design Integration [*]Web
[*]Solutions [*]Clients [*]Portfolio [*]Contact Us
[*]Home [*]About Us [*]Services [*]Solutions [*] Clients
[*]Design Integration [*]Web Templates [*]Design creations [*]Design Integration [*]Web
[*]Portfolio [*]Contact Us
[*]Home [*]About Us [*]Services [*] Solutions
[*]Design Integration [*]Web Templates [*]Design creations [*]Design Integration [*]Web
[*]Clients [*]Portfolio [*]Contact Us
CSS CODE.demo { width: 700px; margin: 40px auto 0; } .nav_block { position: relative; margin-top: 80px; } .nav_block:before { position: absolute; top: 20px; left: -20px; content: ""; border: 10px solid #1a1d1e; border-color: #1a1d1e #1a1d1e transparent transparent; } .nav_block li { float: left; text-align: center; line-height: 40px; } .nav_block > li { width: 100px; } .nav_block li a { position: relative; z-index: 3; display: block; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); } .nav_block li a:hover { text-decoration: none; } .nav_block li:nth-child(1):hover ~ .item_selected { left: 15px; } .nav_block li:nth-child(2):hover ~ .item_selected { left: 115px; } .nav_block li:nth-child(3):hover ~ .item_selected { left: 215px; } .nav_block li:nth-child(4):hover ~ .item_selected { left: 315px; } .nav_block li:nth-child(5):hover ~ .item_selected { left: 415px; } .nav_block li:nth-child(6):hover ~ .item_selected { left: 515px; } .nav_block li:nth-child(7):hover ~ .item_selected { left: 615px; } .item1 { position: relative; background-image: -*-linear-gradient(top,#e50000,#8c0000); } .item2 { position: relative; background-image: -*-linear-gradient(top,#01e851,#07880e); } .item3 { position: relative; background-image: -*-linear-gradient(top,#474fe7,#212989); } .item_selected { position: absolute; top: -8px; left: 215px; z-index: 2; background-image: -*-linear-gradient(top,#f3b743,#a06211); height: 43px; width: 70px; transition: all .3s ease-out; } .item_selected:before, .item_selected:after, .item_selected i:before, .item_selected i:after { position: absolute; content: ""; z-index: -2; border: 3px solid #1a1d1e; border-color: transparent #1a1d1e #1a1d1e transparent; } .item_selected:before { top: 0px; left: -8px; border: 4px solid #f0b441; border-color: transparent #f0b441 #f0b441 transparent; } .item_selected:after { top: 2px; left: -6px; } .item_selected i:before { top: 0px; right: -8px; border: 4px solid #f0b441; border-color: transparent transparent #f0b441 #f0b441; } .item_selected i:after { top: 2px; right: -6px; border-color: transparent transparent #1a1d1e #1a1d1e; } .item_sub { position: absolute; left: 0; width: 700px; background-image: -*-linear-gradient(top,#f8e1e2,rgba(255,255,255,0)); } .item_sub li { border-right: 1px solid #333; margin: 10px 5px; padding-right: 10px; line-height: 15px; } .item_sub li:last-child { border-right: none; } .item_sub li a { display: block; color: #333; text-shadow: none; border-bottom: 5px solid rgba(255,255,255,0); transition: border .2s linear; } .item_sub li a:hover, .item_sub li .active { text-decoration: none; border-bottom: 2px solid #d50000; } .item1 .item_sub li a:hover, .item1 .item_sub li .active { border-color: #d50000; } .item2 .item_sub li a:hover, .item2 .item_sub li .active { border-color: #05a321; } .item3 .item_sub li a:hover, .item3 .item_sub li .active { border-color: #3b43b5; } 演示:http://www.w3cplus.com/demo/css3/colofulDroplineMenu/index.html
下载:colofulDroplineMenu.zip
[/td][/tr]
|