Twitter Bootstrap下拉子菜单背景颜色(Twitter Bootstrap dropdown submenu background color)

编程入门 行业动态 更新时间:2024-10-27 02:19:56
Twitter Bootstrap下拉子菜单背景颜色(Twitter Bootstrap dropdown submenu background color)

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

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

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

更多推荐

本文发布于:2023-07-08 19:25:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1080009.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:菜单   颜色   背景   Bootstrap   Twitter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!