如何更改 FireFox 中悬停的 Select-Option 的颜色 [英] How to change the Color of the hovered Select-Option in FireFox

查看:61
本文介绍了如何更改 FireFox 中悬停的 Select-Option 的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改 FireFox 中悬停的 Select-Option 的颜色,它具有默认的蓝色背景和白色前景.

I want to change the Color of the hovered Select-Option in FireFox which has default blue background and white foreground.

我试过:

<select name="select" size="1">
   <option>0</option>
   <option class="test">1</option>
   <option>2</option>
   <option>3</option>
   <option>4</option>
</select>

.test:hover {
    color:green;
    background-color:yellow;
    text-decoration:underline;
}

但它不起作用.请参阅示例.
一个 FireFox 特定的解决方案就足够了.

But it doesn't work. See Example.
A FireFox specific solution is sufficient.

推荐答案

我发现我可以将图像设置为背景.

I found out that I can set an Image as Backround.

jsfiddle 演示

但它只在 :hover 上绘制,当我从系统呈现的选项中退出鼠标时.

But it is only painted on :hover, when I exit the mouse from the option it will by system rendered.

这篇关于如何更改 FireFox 中悬停的 Select-Option 的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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