Html 选择框背景图片

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9047097/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:07:48  来源:igfitidea点击:

select box background image

htmlcss

提问by cppit

Possible Duplicate:
Background Image for Select (dropdown) does not work in Chrome

可能的重复:
选择(下拉)的背景图像在 Chrome 中不起作用

I need to change the select box background image to https://www.google.com/images/nav_logo101.pngI am using this code:

我需要将选择框背景图片更改为https://www.google.com/images/nav_logo101.png我正在使用此代码:

<form>
    <select id='selectbox'>
        <option >A</option>
        <option >B</option>
    </select>
</form>

it might sound trivial but I tried all sorts of things and unfortunately they all failed.Any help would be appreciated

这可能听起来微不足道,但我尝试了各种各样的事情,不幸的是他们都失败了。任何帮助将不胜感激

FIXED: I used this to fix it:

修复:我用它来修复它:

select#selectbox { -webkit-appearance: none; }

回答by Mattia Larentis

Look here http://jsfiddle.net/8FydL/

看这里http://jsfiddle.net/8FydL/

form select#selectbox {
    width: 100px;
    height: 50px;
    background-image: url('https://www.google.com/images/nav_logo101.png');
}