如何使用 CSS 获得下拉功能?

发布于 2024-10-30 05:41:56 字数 469 浏览 5 评论 0原文

我一直在搞乱这个网站的CSS。我不知道如何让“医疗”菜单项下拉并显示其余的隐藏菜单项。我已经能够取消隐藏并展开它们,但无法将它们下拉。具体来说,我需要改变什么?我尝试了一些教程,但也许我的目标错了?另外,我正在编辑一个主题。也许有什么东西在干扰?请帮助我检查下面的 CSS 并建议一些更改。

谢谢你!

http://madhwaparishat.co.uk/drupal /sites/all/themes/sky/css/style.css?lj2u6r

http://madhwaparishat. co.uk/drupal/

I've been messing with this site's css FOREVER. I can't figure out how to get the "medical" menu item to drop-down and display the rest of the hidden menu items. I've been able to unhide them and expand but not get them to drop-down. What have I got to change, specifically? I tried some tutorials, but maybe I targeted wrong? Also, I'm editing a theme. Maybe something is interfering? Please, help me by inspecting the CSS below and recommending some changes.

thank you!

http://madhwaparishat.co.uk/drupal/sites/all/themes/sky/css/style.css?lj2u6r

http://madhwaparishat.co.uk/drupal/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玩物 2024-11-06 05:41:56

试试这个:

.expanded a:hover + ul,
.expanded ul:hover {display:block !important;z-index:99999;}
.menu ul{position:absolute;}
.menu li{float:left}
.menu .menu a{width:100px}

你的网站上有大量疯狂的 css @imports ,很难调试。 <代码>! important 规则是必要的。

您还需要为下拉链接选择特定的宽度,我使用的是 100px。

希望这有帮助,我本来不想回答,但我看到人们试图向你扔吸盘鱼,而这不是你想要的 - 你想自己做。完全明白了。

编辑:如果你想支持 IE6 和 7,这可能需要调整,或者需要涉及 javascript。

编辑:回来并修剪代码。之前的事情太多了,很混乱。

Try this:

.expanded a:hover + ul,
.expanded ul:hover {display:block !important;z-index:99999;}
.menu ul{position:absolute;}
.menu li{float:left}
.menu .menu a{width:100px}

There's a ton of crazy css @imports on your site, hard to debug. The ! important rule was necessary.

You also need to pick a specific width for you dropdown links, I used 100px.

Hope this helps, I wasn't going to answer but I saw people trying to throw Suckerfish at you, and that's not what you're after - you want to do it yourself. Totally understand.

EDIT: This will probably have to be tuned or javascript will need to be involved if you want to support IE6 and 7.

EDIT: Came back and trimmed the code. There was too much before and it was confusing.

风透绣罗衣 2024-11-06 05:41:56

基本上,您需要 suckerfish 下拉列表

Basically, you want the suckerfish dropdown.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文