如何使CSS菜单中的父对象在儿童悬停时保持悬停状态 [英] How to make a parent object in CSS menu stay in hover state when children are hovered over
本文介绍了如何使CSS菜单中的父对象在儿童悬停时保持悬停状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试制作一个菜单,以便菜单在选择子菜单/子菜单时保持悬停状态:
请参阅此处的示例: http://cssdesk.com/5vJP6
如果有人可以解释需要添加到CSS的内容,以使这项工作非常出色。我不想使用任何外部JavaScript来实现这一点!
我在这里查看了几个类似的问题,但他们的答案都没有工作对我来说
感谢
解决方案
>
#menuh ul li:悬停{颜色:黑色!重要; border-bottom:1px虚线#C1D9F0!重要; }
#menuh ul li:hover li a {color:#505050!important;}
#menuh ul li:hover li a:hover {color:#297BB6!important; }
解决了我的问题: - )
I'm trying to make a menu work so that the menu remains in hover state when it's submenu/child menu is selected:
see example here: http://cssdesk.com/5vJP6
If anyone could explain what needs to be added to the CSS to make this work that would be great. I don't want to use any external javascript to make this happen!
I've had a look at a couple of similar questions here, but none of their answers worked for me
thanks
解决方案
I added this:
#menuh ul li:hover a {color: black !important; border-bottom: 1px dashed #C1D9F0 !important; }
#menuh ul li:hover li a {color: #505050 !important;}
#menuh ul li:hover li a:hover {color: #297BB6 !important; }
Which resolved my problem :-)
这篇关于如何使CSS菜单中的父对象在儿童悬停时保持悬停状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文