css菜单显示与不显示不出来,CSS:下拉菜单不显示

本文探讨了一个网站中CSS下拉菜单无法正常显示的问题。该问题出现在特定的类别如“我们的服务”上,尽管使用了两种不同样式表之一能够使下拉菜单正常工作。文章详细展示了CSS代码片段,并寻求社区的帮助来定位问题所在。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我有这个网站:http://dev.gratefulhearttherapy.org/ 有一个下拉菜单,它应该展开,当你悬停像“我们的服务”或“Abous我们”的类别。但事实并非如此。CSS:下拉菜单不显示

我知道这是一个CSS问题,因为我使用了2种不同的样式表,一种可以工作,而另一种不能。不过,我花了两个小时,并没有发现什么问题。

CSS的相关部分从第287行开始,即“Mega Menu”部分。这里是:

任何人都可以给我一个小费,可能是什么问题?

/* Mega Menu */

.top-level-nav a.nav-path-selected {

color: #EA5603 !important;

ul.mega-menu {

height: 44px;

width: 96%;

text-align: left;

margin: 10px 0 0 20px;

padding: 0 60px;

text-indent: 0;

list-style-type: none;

margin-left: -1px;

}

ul li.mega-menu {

padding: 0;

margin: 0;

text-indent: 0;

display: inline;

line-height: 44px;

}

ul li a.mega-menu {

text-decoration: none;

color: #DE573C;

font-size: 138.5%;

}

.nav li a:hover {

color: #8e4c0f;

}

.custom {line-height: 1.6;}

.custom ul.mega-menu, .custom ul.mega-menu, .custom ul.mega-menu li {margin: 0; padding: 0; border: none;}

.custom ul.mega-menu {

background: #D6CEB4;

width: 100%;

height: 44px;

border-top: solid 2px #CCC2A5;

border-bottom: solid 2px #CCC2A5;

-webkit-border-radius: 4px;

-moz-border-radius: 4px;

border-radius: 4px;; position: relative;

}

.custom ul.mega-menu li {float: left; margin: 0; padding: 0; }

.custom ul.mega-menu li a {float: left; display: block; padding: 12px 38px 12px 25px; ; text-decoration: none; color: #3B3B3B; font-size: 138.5%; text-decoration: none;}

.custom ul.mega-menu li a.dc-mega {position: relative;}

.custom ul.mega-menu li a .dc-mega-icon {display: block; position: absolute; top: 18px; right: 15px; width: 8px; height: 6px; background: url(images/arrow.png) no-repeat 0 0;}

.custom ul.mega-menu li.mega-hover a, .custom ul.mega-menu li a:hover {background-position: 100% -40px; color: #8e4c0f;}

.custom ul.mega-menu li.mega-hover a .dc-mega-icon {background-position: 0 100%;}

.custom ul.mega-menu li .sub-container { /* block container of dropdown submenu when it's closed (I think) */

position: absolute;

background: url(images/bg_sub_left.png) no-repeat 0 100%;

padding: 10px 10px 0 10px;

margin-left: -3px;

}

.custom ul.mega-menu li .sub { /* dropdown submenu itself */

margin: -8px 0 0 -8px;

background: #E3DDD3

url(images/bg_sub.png) no-repeat 100% 100%;

padding: 00px 20px 20px 10px;

border: 1px #D1C6B4;

border-style: none solid solid solid;

/* rounded corners */

-webkit-border-bottom-right-radius: 3px;

-webkit-border-bottom-left-radius: 3px;

-moz-border-radius-bottomright: 3px;

-moz-border-radius-bottomleft: 3px;

border-bottom-right-radius: 3px;

border-bottom-left-radius: 3px;

/* dropshadow effect */

-webkit-box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);

-moz-box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);

box-shadow: 0px 4px 6px rgba(50, 50, 50, 0.6);

}

.custom ul.mega-menu li .sub-container.mega .sub {padding: 20px 20px 10px 0;}

.custom ul.mega-menu li .sub .row {width: 100%; overflow: hidden; clear: both;}

.custom ul.mega-menu li .sub li {list-style: none; float: none; width: 170px; font-size: 120%; line-height: 2;} /* li of dropdown submenu */

.custom ul.mega-menu li .sub li.mega-hdr {margin: 0 10px 10px 0; float: left;}

.custom ul.mega-menu li .sub li.mega-hdr.last {margin-right: 0;}

.custom ul.mega-menu li .sub a, .custom ul.mega-menu li .sub span {background: none; border: none; text-shadow: none; color: #111; padding: 7px 10px; display: block; float: none; text-decoration: none; font-size: 0.9em;}

.custom ul.mega-menu li .sub li.mega-hdr .mega-hdr-a {padding: 5px 5px 5px 15px; margin-bottom: 5px; background: #6B6B6B url(images/bg_mega_hdr.png) no-repeat 0 0; text-transform: uppercase; font-weight: bold; color: #fff; text-shadow: 1px 1px 1px #333;}

.custom ul.mega-menu li .sub li.mega-hdr a.mega-hdr-a:hover {color: #000; text-shadow: none;}

.custom ul.mega-menu .sub li.mega-hdr li a {padding: 4px 5px 4px 20px; background: url(images/arrow_off.png) no-repeat 5px 8px; font-weight: normal;}

.custom ul.mega-menu .sub li.mega-hdr li a:hover {color: #a32403; background: #efefef url(images/arrow_on.png) no-repeat 5px 8px;}

.custom ul.mega-menu .sub ul li {padding-right: 0;}

.custom ul.mega-menu li .sub-container.non-mega .sub {padding: 20px 20px 20px 0;}

.custom ul.mega-menu li .sub-container.non-mega li {padding: 0; width: 190px; margin: 0;}

.custom ul.mega-menu li .sub-container.non-mega li a {padding: 7px 5px 7px 22px; background: url(images/arrow_off.png) no-repeat 7px 10px;}

.custom ul.mega-menu li .sub-container.non-mega li a:hover {color: #a32403; background: #efefef url(images/arrow_on.png) no-repeat 7px 10px;}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值