在twitter bootstrap中有一个类“下拉菜单”,例如。<ul class="dropdown-submenu">
。
如你所见,它右边有一个箭头。如何在悬停时将箭头的颜色设置为暗?
答案 0 :(得分:1)
您可以通过以下方式完成此操作:
对于Dropdown-menu onhover颜色更改:
.navbar .nav li.dropdown > a:hover .caret, .navbar .nav li.dropdown > a:focus .caret {
border-bottom-color: red;/*change color to your liking*/
border-top-color: red;/*change color to your liking*/
}
激活时更改插入符号的颜色(下拉菜单):
.navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret {
border-bottom-color: #008745;/*change color*/
border-top-color: #008745;/*change color*/
}
对于下拉子菜单
.dropdown-submenu > a:after {
border-color: transparent transparent transparent #000000;/*change here */
border-style: solid;
border-width: 5px 0 5px 5px;
content: " ";
display: block;
float: right;
height: 0;
margin-right: -10px;
margin-top: 5px;
width: 0;
}
下拉子菜单onHover颜色更改:
.dropdown-submenu:hover > a:after{
border-left-color:#fff; /* change the color to anything of your choice*/
}
此处设置了插入符号的默认颜色,可以在下面提到的位置进行更改:
.caret {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #FFFFFF; /* change the color to anything of ur liking */
content: "";
display: inline-block;
height: 0;
vertical-align: top;
width: 0;
}
答案 1 :(得分:0)
只需切换字形图像?
.dropdown-submenu:hover{
i{
background-image: url("../images/bootstrap/glyphicons-halflings-white.png");
}
只需从google或字形图片下载彩色图标图片文件,或在photoshop中自行更改