我的下拉菜单的背景颜色有点麻烦。 我在悬停时将背景颜色的颜色更改为橙色。 但是,如果我转到该下拉列表中的任何子菜单,则父项的颜色将更改为默认蓝色。 不知道,如何更好地解释,我只会展示一张图片:
因此,只要我将鼠标悬停在子项目上,父级背景颜色就会变为蓝色。 我试图做一个选择器,但没有想法。 有什么帮助吗?
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选择器都被覆盖......
/* 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
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; }Demo: http://bootply.com/75155
更多推荐
发布评论