在下拉菜单中突出显示顶部菜单项 [英] Keeping top menu item highlighted while in dropdown

查看:137
本文介绍了在下拉菜单中突出显示顶部菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要将这个网站整合在一起,并且当您将鼠标悬停在下拉菜单项目上时,希望具有下拉列表的菜单项以白色突出显示。
http://dl.dropbox.com/u/7086475 /Paul%20Day/index.html

Just putting together this site and would like the menu item with a dropdown to stay highlighted in white when you are hovering over the dropdown menu items. http://dl.dropbox.com/u/7086475/Paul%20Day/index.html

推荐答案

而不是使用 #nav a :hover 选择器可以使用 #nav li:hover

Instead of using the #nav a:hover selector you can use #nav li:hover instead.

将不会像锚点一样在子菜单中保持悬停状态。

The li will remain in the hover state while you're in the submenu unlike the anchor.

由于悬浮伪类仅适用于锚点,因此IE6将无法正常工作。 / p>

It won't work in IE6 since the hover pseudo class only works on anchors.

#nav li:hover{
 color: #fff;
}

这篇关于在下拉菜单中突出显示顶部菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆