淘宝导航栏css代码分享

所属分类: 网页制作 / CSS 阅读数: 1683
收藏 0 赞 0 分享

类似淘宝的导航栏

html代码

复制代码
代码如下:

<div class="end_wrap">
<div class="end_box">
<ul>
<li class="shiling">
<dl>
<dt>
<h3>时令周边游</h3>
<p><a href="">天数</a><a href="">丽水</a><a href="">台州</a><a href="">休闲度假</a></p>
</dt>
<dd>
<div class="navcontent clear">
<div class="subitem">
<div class="li_dl">
<div class="li_dl_dt">漂流</div>
<div class="li_dl_dd"><em><a href="">大峡谷</a></em><em><a href="">三清山</a></em><em><a href="">千岛湖</a></em></div>
</div>
<div class="li_dl">
<div class="li_dl_dt">游乐园</div>
<div class="li_dl_dd"><em><a href="">大峡谷</a></em><em><a href="">三清山</a></em><em><a href="">千岛湖</a></em></div>
</div>
</div>
<div class="subitem">
<div class="li_dl">
<div class="li_dl_dt">名山明水</div>
<div class="li_dl_dd"><em><a href="">大峡谷2</a></em><em><a href="">三清山2</a></em><em><a href="">千岛湖2</a></em></div>
</div>
</div>
</div>
</dd>
</dl>
</li>
<li class="guonei">
<dl>
<dt>
<h3>国内风行游</h3>
<p><a href="">天数</a><a href="">丽水</a><a href="">台州</a><a href="">休闲度假</a></p>
</dt>
<dd>
2
</dd>
</dl>
</li>
<li class="guoji">
<dl>
<dt>
<h3>国际风尚游</h3>
<p><a href="">天数</a><a href="">丽水</a><a href="">台州</a><a href="">休闲度假</a></p>
</dt>
<dd>
3
</dd>
</dl>
</li>
<li class="gongsi">
<dl>
<dt>
<h3>公司游</h3>
<p><a href="">天数</a><a href="">丽水</a><a href="">台州</a><a href="">休闲度假</a></p>
</dt>
<dd>
3
</dd>
</dl>
</li>
<li class="visa">
<dl>
<dt>
<h3>签证</h3>
<p><a href="">天数</a><a href="">丽水</a><a href="">台州</a><a href="">休闲度假</a></p>
</dt>
<dd>
5
</dd>
</dl>
</li></p> <p> </ul>
</div>
</div>

js代码

复制代码
代码如下:

$(function(){
$('.end_box ul li').each(function(){
$(this).hover(function() {
$(this).addClass('hover')
}, function() {
$(this).removeClass('hover')
});
})
})

css

复制代码
代码如下:

*{ margin: 0px; padding: 0px;}
ul,li{ list-style:none;}
img{ border: 0;}
body{font-family: "Microsoft YaHei","微软雅黑",Arial,Helvetica,sans-serif;color: #404040; font-size: 14px;}
.clear { clear:both; zoom:1;}
.clear:after {visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0;}
.hide{ display: none;}
.show{ display: block;}
.fl{ float: left;}
.fr{ float: right;}
.pb10{ padding-bottom: 10px;}
.f12{ font-size: 12px; font-family: 微软雅黑;}
.f14{ font-size: 14px; font-family: 微软雅黑;}
.site_wrap{ width: 100%;}
.sitenav{ float: left; width: 10%; background: #fcfcfc; padding: 10px 0;}
.nav_top,.nav_con{ width: 95%; margin: 0px auto;}
.nav_top{ margin-bottom: -1px;}
.nav_top ul li{ float: left; display: inline; margin-right: 3px; padding: 0 15px; height: 25px; line-height: 25px; border-radius:2px; background: #cfcfcf; color: #333; border: 1px solid #ccc; margin-left: -1px; cursor: pointer;}
.nav_top ul li.on{ background: #fff; color: #000; border-bottom: 1px solid #fff;}
.nav_con{ border: 1px solid #ccc;}
.navcontent{}
.sitecontent{ float: left; width: 90%; padding: 10px 0;}
.width130{ float: left; width: 130px; text-align: right; padding-right: 40px; line-height: 25px;}
.con_style{}
.con_style input[type='text']{ width: 180px; border-radius: 2px; border: 1px solid #c5c5c5; border-top: 1px solid #c4c4c4; height: 23px; line-height: 23px; padding: 0 5px;-webkit-box-shadow: 1px 1px 1px 0px rgba(0,0,0,.0) inset; box-shadow: 1px 1px 1px 0px rgba(0,0,0,.1) inset;}
.con_style input[type='button'],.con_style button{ border-radius: 2px; border: 1px solid #afafaf; border-top: 1px solid #b0b0b0; height: 25px; line-height: 25px; padding: 0 15px; margin-left: 5px; cursor: pointer;*overflow:visible;}
.con_style input[type='checkbox'],.con_style input[type='radio']{ position: relative; margin-right: 2px; display: inline; cursor: pointer;}
.con_style input[type='file']{height: 25px; line-height: 25px; }
.con_style select{ height: 25px; line-height: 25px; padding: 0; width: 180px; border-radius: 2px; border: 1px solid #c5c5c5; border-top: 1px solid #c4c4c4;}
.con_style label{ padding-right: 25px;}
.con_style input.width80{ width: 80px; margin-left: 5px;}
.search_con{ border:1px solid #ccc; padding: 15px; margin: 10px 0;}
.con_title{ height: 30px; line-height: 30px; color: #000; font-weight: bold;}
.con_con label{ display: inline-block;}</p> <p>.end_wrap{ width: 80%;}
.end_box{ margin: 6px; height: 320px; background: #f8f6f8; margin-top: 0; position: relative; border-right: 1px solid #f8f6f8;}
.end_box li{ display: block; height: 62px; background-position: 20px center; background-repeat: no-repeat; border-right: 1px solid #ccc; width: 297px;}
.end_box li:hover {background-color: #fff;border: 1px solid #ccc;border-right: 1px solid #fff;}
.end_box h3{color: #f39b19; font-size: 13pt;}
.end_box a{margin-right: 10px; text-decoration: none; color: #404040;}
.end_box li dl{ padding-left: 75px; padding-top: 10px; padding-bottom: 3px; width: 223px;}
.end_box li dl dt{ display: block;position: relative;}
.end_box li dl dd{ width: 867px; border: 1px solid #ccc; height: 318px; position: absolute; z-index: 2; left: 298px; background: #fff; top: 0; display: none; border-left: 0 none; overflow-y: auto;}
.end_box li.hover dl dd{ display: block;}
.end_box .shiling{ background-image: url(../images/ico_shiling.png);}
.end_box .guonei{ background-image: url(../images/ico_train.png);}
.end_box .guoji{ background-image: url(../images/ico_plane.png);}
.end_box .gongsi{ background-image: url(../images/ico_men.png);}
.end_box .visa{ background-image: url(../images/ico_visa.png);}</p> <p>.subitem { float: left; width: 385px; min-height: 65px; padding-left: 15px; z-index: 100;}
.subitem .li_dl { overflow: hidden; zoom: 1; padding: 5px 0; }
.subitem .li_dl_dt { float: left; width: 85px; line-height: 20px; text-align: left; color: #f39b19;}
.subitem .li_dl_dd { float: left; width: 300px; }
.subitem em { float: left; font-style: normal; white-space: nowrap; height: 14px; line-height: 14px; border-right: 1px solid #ccc; margin: 3px 0; padding: 0 8px; }
.subitem em:last-child { border: 0 none; }

更多精彩内容其他人还在看

CSS样式分离之再分离达到精简与重用

无论是CSS的分离还是js的分离,其主要作用之一就是精简与重用,CSS本身就代表着精简与重用,CSS样式分离,我一般指的是“以单独的CSS文件将CSS样式分离出来”,此处的重用多针对不同页面的重用,就是说,一个样式文件,可以多个页面使用,这对于一些公共样式的重构是很有
收藏 0 赞 0 分享

CSS属性behavior的语法使用说明

在进行CSS网页布局的时候,我们经遇到刷新要保留表单里内容的时候,习惯的做法使用cookie,但是那样做实在是很麻烦,css中的behavior就为我们很好的解决了这个问题。今天jb51.net就向大家介绍CSS属性behavior的语法
收藏 0 赞 0 分享

网页制作中的水平居中和垂直居中解决方法集合

 在定义网页的CSS样式的时候,我们或许并不怎么用到垂直居中。
收藏 0 赞 0 分享

最常见IE的Bug及其fix修复方法

Internet Explorer – Web程序员的毒药。在IE上开发时间中有超过60%的时间是花在和IE的bug进行搏斗,让你的开发生产率严重下降。下面是一个教程,告诉你9个IE上最常见的BUG以及如何解决它们。
收藏 0 赞 0 分享

CSS常用浏览器兼容调整小结

用CSS+DIV来写网站代码的好处显而易见,这里不多说了,但由于不同浏览器对CSS的解释不统一,造成不同浏览器下页面错位的现象十分常见……
收藏 0 赞 0 分享

css firefox火狐浏览器下的兼容性问题

css firefox火狐浏览器下的兼容性问题
收藏 0 赞 0 分享

DIV+CSS 浏览器兼容性小结

在网站设计的时候,应该注意css样式兼容不同浏览器问题,特别是对完全使用DIV CSS设计的网,就应该更注意IE6 IE7 FF对CSS样式的兼容,不然,你的网乱可能出去不想出现的效果!
收藏 0 赞 0 分享

div+css 布局常识 8问

CSSer与其他IT职位一样,在找工作的时候,都会面临着面试官提出的问题,或者给出的试卷。今天jb51.net收集了常见的8条面试题目,希望对您有所帮助。
收藏 0 赞 0 分享

CSS用四种方式实现布局

CSS用四种方式实现布局
收藏 0 赞 0 分享

css 解决表格边框不显示的问题

在 IE6 中,当表格单元格中的数据为空时,边框是不显示的,在IE8中是会显示的,怎样解决这个不兼容的问题呢。
收藏 0 赞 0 分享
查看更多