如何显示下拉菜单超过标题div

发布于 2024-09-10 05:49:51 字数 270 浏览 1 评论 0原文

我在显示下拉菜单时遇到问题。请参阅以下示例:

http://staging.gwynconsulting.com/rif/ hello-world-2/

当我将鼠标悬停在“租用完成”时,我无法显示所有菜单项。

我尝试使用许多 css 属性,但我无法使其工作...

谢谢...

I have problem in displaying drop-down menu. Please, see the example on:

http://staging.gwynconsulting.com/rif/hello-world-2/

When I hover 'Rent it finished', I can't display all menu items.

I tried to play with many css properties, but I can't make it work...

Thank you...

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

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

发布评论

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

评论(2

╰◇生如夏花灿烂 2024-09-17 05:49:51

第一个子项目被裁剪是由于 #header#nav 上的两个 overflow: hide; CSS 指令造成的。
删除这两条指令,您将看到子菜单。

由于列表项是浮动的,#nav 不再具有流动内容,因此高度为 0:背景已消失。
您应该将背景图像放在每个单独的浮动列表项上,无论是 ul 还是父项。

从可访问性的角度来看,除非必要,否则不应在链接上添加标题属性。在这里,您的链接文本是明确的,并且您的标题与文本完全相同:您的标题是不必要的。

<a href="/" title="Home">Home</a> <!-- not OK. Title attribute should be removed -->
<a href="/brochure.pdf" title="Download our brochure (PDF, 1.53 MB)">Download our brochure</a> <!-- OK, 2 useful infos about format and size added -->
<a href="/brochure.pdf" title="(PDF, 1.53 MB)">Download our brochure</a> <!-- not OK, title should include the text of the link and add sth to it -->

The first sub-item being cropped is due to two overflow: hidden; CSS instructions on #header and #nav.
Remove both instructions and you'll see sub-menus.

As your list-items are floating, #nav no longer have flowing content and thus has an height of 0: background has disappeared.
You should put your background-images on each individual floating list-item whether than ul or a parent.

From an accessibility point of view, you should not add title attributes on your links except if necessary. Here the text of your links are explicit as is and your titles are strictly identical to text: your titles are unnecessary.

<a href="/" title="Home">Home</a> <!-- not OK. Title attribute should be removed -->
<a href="/brochure.pdf" title="Download our brochure (PDF, 1.53 MB)">Download our brochure</a> <!-- OK, 2 useful infos about format and size added -->
<a href="/brochure.pdf" title="(PDF, 1.53 MB)">Download our brochure</a> <!-- not OK, title should include the text of the link and add sth to it -->
春夜浅 2024-09-17 05:49:51

您需要将 z-index 和位置添加到主 div 和内容 div 的顶部,将它们推回导航 div 后面。请参阅 http:// www.smashingmagazine.com/2009/09/15/the-z-index-css-property-a-compressive-look/

并且您的样式表之一抛出 404: http://staging.gwynconsulting.com/rif/wp-内容/主题/rif/js/gallery/jquery.ad-gallery.css

You need to add a z-index and a positon to your main and content div's top push them back behind the nav div. See http://www.smashingmagazine.com/2009/09/15/the-z-index-css-property-a-comprehensive-look/

And one of your style sheets throws a 404: http://staging.gwynconsulting.com/rif/wp-content/themes/rif/js/gallery/jquery.ad-gallery.css

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