您现在的位置是:网站首页> 编程资料编程资料
淘宝导航栏css代码分享html+css+js实现导航栏滚动渐变效果不可思议的CSS导航栏下划线跟随效果html+css 实现简易导航栏功能CSS中的导航栏和下拉菜单的实现纯CSS实现导航栏下划线跟随滑动效果使用CSS制作立体导航栏div+css实现带箭头的面包屑导航栏CSS导航栏及弹窗示例代码纯CSS实现导航栏Tab切换效果CSS利用伪元素实现导航栏斜线分隔
2021-09-06
986人已围观
简介 这篇文章主要介绍了淘宝导航栏css代码示例,需要的朋友可以参考下
类似淘宝的导航栏
html代码
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;}
.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);}
.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; }
相关内容
- ie下margin不居中的三种解决方法浅谈原生页面兼容IE9问题的解决方案新版chrome浏览器设置允许跨域的实现css hack之\9和\0就可能对hack IE11\IE9\IE8无效css区分ie8/ie9/ie10/ie11 chrome firefox的代码解决CSS浏览器兼容性问题的4种方案常见的浏览器兼容性问题(小结)border-radius IE8兼容处理的方法浅谈遇到的几个浏览器兼容性问题base64图片在各种浏览器的兼容性处理 对常见的css属性进行浏览器兼容性总结(推荐)
- 通过纯CSS样式实现DIV元素中多行文本超长自动省略号兼容IE和FF的单行溢出文本显示省略号-CSS教程-网页制作-网页教学网字符串过长CSS截取多余文字并用省略号显示css实现字符串截断并加省略号示例css样式显示省略号自定义宽度超过隐藏显示省略标记CSS省略号text-overflow超出溢出显示省略号CSS 控制字符宽度省略号效果 兼容浏览器CSS文本超出div或者span时用省略号代替
- 用条件注释判断浏览器版本解决页面兼容问题浅谈原生页面兼容IE9问题的解决方案新版chrome浏览器设置允许跨域的实现css hack之\9和\0就可能对hack IE11\IE9\IE8无效css区分ie8/ie9/ie10/ie11 chrome firefox的代码解决CSS浏览器兼容性问题的4种方案常见的浏览器兼容性问题(小结)border-radius IE8兼容处理的方法浅谈遇到的几个浏览器兼容性问题base64图片在各种浏览器的兼容性处理 对常见的css属性进行浏览器兼容性总结(推荐)
- CSS3 Columns分列式布局方法简介CSS columns实现两端对齐布局的示例代码浅谈CSS 多栏布局(Multi-Columns Layout)
- css实现字符串截断并加省略号示例兼容IE和FF的单行溢出文本显示省略号-CSS教程-网页制作-网页教学网字符串过长CSS截取多余文字并用省略号显示通过纯CSS样式实现DIV元素中多行文本超长自动省略号css样式显示省略号自定义宽度超过隐藏显示省略标记CSS省略号text-overflow超出溢出显示省略号CSS 控制字符宽度省略号效果 兼容浏览器CSS文本超出div或者span时用省略号代替
- 纯css绘制蜂巢六边形效果css3实现六边形边框的实例代码css画正六边形的两种方法css实现六边形图片的示例代码CSS实现图片背景填充的六边形的示例代码CSS3绘制六边形的简单实现纯css实现的六边形(蜂窝)导航效果(支持hover/兼容浏览器)CSS 实现蜂巢/六边形图集的示例代码
- 一个不错的html视频播放器兼容主流浏览器实现简易html视频播放器的方法
- 设置网站二级导航及把二级导航做的好看设置div背景透明的方法示例CSS实现div不设高度完全居中div自适应高度自动填充剩余高度详解DIV+CSS的命名规矩才能有利于SEO优化的实现方法DIV或者DIV里面的图片水平与垂直居中的方法详解如何用div实现自制滚动条div对齐与网页布局详解DIV+CSS实现电台列表设计的示例代码div+css实现带箭头的面包屑导航栏不定宽高的文字在div中垂直居中实现方法
- css及js调用方法详细汇总CSS Transition通过改变Height实现展开收起元素从QQtabBar看css命名规范BEM的详细介绍css实现两栏布局,左侧固定宽,右侧自适应的多种方法CSS 实现Chrome标签栏的技巧CSS实现两列布局的N种方法CSS实现隐藏搜索框功能(动画正反向序列)CSS3中Animation实现简单的手指点击动画的示例详解CSS中的特指度和层叠问题详解overflow:hidden的作用(溢出隐藏、清除浮动、解决外边距塌陷)关于CSS浮动与取消浮动的问题
- css行内元素padding,margin,width,height没有变化CSS中height和width在IE和其他浏览器中的区别图文详解IE6不支持CSS中的min-width/height属性问题的解决方法