如何显示下拉菜单超过标题div
我在显示下拉菜单时遇到问题。请参阅以下示例:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一个子项目被裁剪是由于
#header
和#nav
上的两个overflow: hide;
CSS 指令造成的。删除这两条指令,您将看到子菜单。
由于列表项是浮动的,
#nav
不再具有流动内容,因此高度为0
:背景已消失。您应该将背景图像放在每个单独的浮动列表项上,无论是 ul 还是父项。
从可访问性的角度来看,除非必要,否则不应在链接上添加标题属性。在这里,您的链接文本是明确的,并且您的标题与文本完全相同:您的标题是不必要的。
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 of0
: 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.
您需要将 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