Twitter Bootstrap下拉子菜单背景色 [英] Twitter Bootstrap dropdown submenu background color

查看:60
本文介绍了Twitter Bootstrap下拉子菜单背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的下拉菜单的背景色有点麻烦.我将悬停时的背景色更改为橙​​色.但是,如果我转到该下拉菜单中的任何子菜单,则父项的颜色将更改为默认的蓝色.不知道,如何更好地解释它,我只会显示一张图片:

I'm having a little trouble with background color of my dropdown menu. I changed the color of background color on hover to orange. But, if I go to any submenu in that dropdown, the color of parent item change to default blue. Don't know, how to explain it better, I will just show a picture:

因此,一旦我将鼠标悬停在子项目上,父级背景颜色就会变为蓝色.我试图为此做一个选择器,但想法不多了.有什么帮助吗?

So, as soon as I hover over subitem, the parent background color change to blue. I was trying to do a selector for that but ran out of ideas. Any help please?

推荐答案

我认为您需要类似的东西来确保所有CSS选择器都被覆盖...

I think you need something like this to ensure all CSS selectors are covered...

/* change background color on hover */
.dropdown-submenu > a:focus, .dropdown-submenu > a:hover, .dropdown-submenu:focus>a, r, .dropdown-submenu:hover>a,
.dropdown-menu > li a:hover,
.dropdown-menu > li a:focus { background-color: orange; background-image: none; filter: none; text-decoration: none; border: none; }

演示: http://bootply.com/75155

这篇关于Twitter Bootstrap下拉子菜单背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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