如何更改选择列表中的默认蓝色 [英] How I can change the default blue color in select list

查看:117
本文介绍了如何更改选择列表中的默认蓝色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个选择列表。



它有它的默认蓝色,我想覆盖。
我要在:hover 选择上定义自定义颜色,然后点击(:focus :active 。)。



我正在使用 bootstrap
我尝试了一些代码,但它不工作。



我想把蓝色变成绿色。



这是我的



请指导我。

解决方案

使用伪元素播放。您需要创建一个类.yourdrodown ul li:active,:focus和:hover并设置背景颜色。



例如:

  .yourdropdown ul li:active,.yourdropdown ul li:hover,.yourdropdown ul li:focus {
background-color:green;
}


I have a select list.

It is having its default blue color which I want to overwrite. I want to define custom color on :hover, selection and clicked(:focus and :active.).

I am using bootstrap. I've tried some code but it doesn't work.

I want to change that blue color into some green color for example. it should be same if select box is open highlight with that color.

Here's my JSFiddle

Here' the issue I have:

Please guide me.

解决方案

Play with pseudoelements. You need to make a class .yourdrodown ul li:active, :focus and :hover and set the background color.

For example:

.yourdropdown ul li:active, .yourdropdown ul li:hover, .yourdropdown ul li:focus {
    background-color: green;
}

这篇关于如何更改选择列表中的默认蓝色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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