为什么当设置为transparent时,html在Chrome中选择背景颜色为黑色? [英] Why is the html select background-color black in Chrome when set to transparent?

查看:930
本文介绍了为什么当设置为transparent时,html在Chrome中选择背景颜色为黑色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下下拉菜单,背景在Chrome中显示为黑色,但在Windows / Linux / Mac上的Firefox / IE / Safari上为白色。我使用的是所有这些浏览器的最新版本。

I have the following drop down menu and the background looks black in Chrome but white on Firefox/IE/Safari across Windows/Linux/Mac. I'm using the latest versions of all those browsers.

<style>
select {
    background-color: transparent;
    background-image: url(http://sstatic.net/so/img/logo.png);
}
</style>
<select>
    <option>Serverfault</option>
    <option>Stackoverflow</option>
    <option>Superuser</option>
</select>

有没有人知道我如何风格上述,使Chrome显示的背景为白色的颜色设置为透明,像在其他浏览器?

Does anyone know how I can style the above so that Chrome shows the background as white when the color is set to transparent like in the other browsers?

编辑:
我的目标是在select的背景中显示一个图像。

My goal is to display an image in the background of select. The image shows up properly in every browser except Chrome.

推荐答案

根据 this and 是Chrome中的错误,应该修复。

According to this and this, it is a bug in Chrome that is supposed to be fixed.

错误出现在2.0版本中。我只是在3.0-beta测试,它是固定的。

The bug appears in version 2.0. I just tested it in 3.0-beta, and it's fixed.

这篇关于为什么当设置为transparent时,html在Chrome中选择背景颜色为黑色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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