css - 为什么设置为透明时 html 在 Chrome 中选择背景颜色为黑色?

标签 css google-chrome

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

<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 在颜色设置为透明时像其他浏览器一样将背景显示为白色?

编辑: 我的目标是在选择的背景中显示图像。该图像在除 Chrome 之外的所有浏览器中都能正常显示。

最佳答案

根据 thisthis ,它是 Chrome 中的一个错误,应该被修复。

该错误出现在 2.0 版本中。我刚刚在 3.0-beta 中对其进行了测试,并且已修复。

关于css - 为什么设置为透明时 html 在 Chrome 中选择背景颜色为黑色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1381175/

相关文章:

javascript - 在某个滚动点开始一个页面

php - 在 PHP 文件中包含 CSS 文件包含在 PHP 文件中

c# - 如何覆盖或删除网页中的母版页CSS

javascript - 什么是 toLocaleString()?

google-chrome - chrome,源 map 未加载

html - IFrame 内容在 IE7 和 IE=EmulateIE7 (Sharepoint) 中显示为白色

html - 如何设置从表单集中动态添加的表单的样式

java - request.getParameter 在 Chrome 中返回空值

javascript - 强制链接在同一窗口/选项卡中打开

html - 在 Chrome Dev Tools 中模拟移动设备时,HTML 和正文的大小如何处理?