博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
仿京东商城,一号店商品多级分类精美菜单
阅读量:7059 次
发布时间:2019-06-28

本文共 4803 字,大约阅读时间需要 16 分钟。

上段时间,商城改版,其中需要设计一个像京东商城,一号店那样的商品分类弹出菜单,参考了下它们的,终于弄出来了,现在和大家分享下:

代码片段:

 CSS 代码:

body {color: #666666;font: 12px Arial,Lucida,Verdana,Helvetica,sans-serif;height: 100%;width: 100%;padding:10px;}*{margin: 0;padding: 0;}em{font-style:normal; margin:0;padding:0;}ul{ list-style:none; margin:0;padding:0;}.clr{ display:block; clear:both; overflow:hidden; height:0; line-height:0; font-size:0;}img{border:0;}a{ color: #666666;text-decoration:none;outline:none;}a:hover{text-decoration:underline;}#category {background-color: #F8EEDA;border: 2px solid #990000; width: 201px; }#category .title {background: url(themes/mall/yhd/styles/default/images/common_bg.gif) no-repeat scroll -165px -169px transparent;    height: 25px;width: 195px; margin-left:-2px; margin-top:-1px; padding-top:12px; padding-left:10px;}#category .title a {color:#910000;cursor: pointer;text-decoration: none; font-size:16px;}#category .content { display: block; position:relative; z-index:999}#category .content .item,#category .content .hover,#category .content .item:hover{ padding-left:10px;text-align:left;height:36px; line-height:36px;}#category .content .item h2{ background: url(jiantou.gif) no-repeat;cursor: pointer;display:block; width:185px; height:35px; line-height:35px; border-bottom:1px solid #DFCA9F; }#category .content .item h2 a{ font:14px Arial,Lucida,Verdana,Helvetica,sans-serif;padding-left:5px; color:#910000; font-weight:normal; height:35px; line-height:35px; }#category .content .item h2 a:hover{ text-decoration:none;}#category .content .item .out,#category .content .item b{ display:none;}#category .content .hover h2,#category .content .item:hover h2{ border:1px solid #990000;margin-left:-1px; height:34px; line-height:34px; position:relative; z-index:999; _width:167px; width:167px; background:#FFF!important;}#category .content .hover .out,#category .content .item:hover .out{ display:block; position:absolute; left:177px; top:0;border:1px #990000 solid;  background:#fff;width:580px; float:left; z-index:998; min-height:360px;_height:360px; background:#F8EEDA;}#category .content .hover h2 b,#category .content .item:hover h2 b{ position:absolute; display:block;height:34px; width:1px;overflow:hidden; left:167px;top:0;background:#fff; z-index:1001;}#category .content .hover h2 a,#category .content .item:hover h2 a{ padding-left:5px; color: #910000; font: 14px/35px Arial,Lucida,Verdana,Helvetica,sans-serif;}#category .content .hover .out .subcategory,#category .content .item:hover .out .subcategory{width:400px; float:left;  background:#FFF; min-height:360px;height:100%;}#category .content .hover .out .subcategory .dl,#category .content .item:hover .out .subcategory .dl{ border-bottom:1px dotted #ccc; overflow:hidden;margin:0 10px; padding:5px 0; float:left; display:inline;}#category .content .hover .out .subcategory dt,#category .content .item:hover .out .subcategory dt{float:left; width:70px;  display:inline-block;}#category .content .hover .out .subcategory dt a,#category .content .item:hover .out .subcategory dt a{color: #BF0000;  font-weight:bold;line-height:14px;margin:5px 0;}#category .content .hover .out .subcategory dd,#category .content .item:hover .out .subcategory dd{ padding-left:5px; float:left;width:300px; vertical-align:middle;}#category .content .hover .out .subcategory dd a,#category .content .item:hover .out .subcategory dd a { border-right: 1px solid #F1E3E3; color: #545454;height: 14px;line-height: 14px;padding: 0 8px;white-space:nowrap;margin:5px 0; float:left;}#category .content .hover .out .subcategory dd .nbd,#category .content .item:hover .out .subcategory dd .nbd{ border:none;}#category .content .hover .out .subcategory dd a:hover,#category .content .item:hover .out .subcategory dd .hover{ color:#bf0000;} #category .content .hover .out .hotview,#category .content .item:hover .out .hotview{float:right;padding: 0 18px; width: 140px;  min-height:360px; _height:360px;}#category .content .hover .out .hotview h3,#category .content .item:hover .out .hotview h3 {color: #bf0000; font-weight:bold; height: 31px;line-height: 31px; margin:0;padding: 0;}#category .content .hover .out .hotview div a,#category .content .item:hover .out .hotview div a{color: #666666; display:block; margin-right: 10px; white-space:nowrap;}

 

上面效果通过IE6,IE7,IE8,IE9,火狐,谷歌等主流浏览器测试

 

完整代码下载地址

 

 

转载于:https://www.cnblogs.com/xxm6318/archive/2012/07/27/2612472.html

你可能感兴趣的文章
转:IIS虚拟目录实现与文件服务器网络驱动器映射共享
查看>>
解决 MariaDB无密码就可以登录的问题
查看>>
AP_MergeSql
查看>>
2016/4/3 总结作业
查看>>
用node.js写一个jenkins发版脚本
查看>>
iOS开发-UITabBarController详解
查看>>
算法-动态连通性
查看>>
webBrowser控件
查看>>
Oracle动态执行脚本创建序号
查看>>
普通变量和数组作为函数参数的区别
查看>>
ActionMailer设置发送邮件的地址用户名之类的放在environment里面可以,放在development里面不行。...
查看>>
算法68------数组和矩阵问题
查看>>
Ueditor的用法
查看>>
操作系统学习笔记:分布式协调
查看>>
I.MX6 AW-NB177NF WIFI 驱动移植问题
查看>>
当数据量大时的加载原理?
查看>>
2019年广东省赛gdccpc回顾
查看>>
关系型数据库 VS 非关系型数据库
查看>>
Java学习第十七天
查看>>
关于我
查看>>