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
select box background image
提问by cppit
Possible Duplicate:
Background Image for Select (dropdown) does not work in 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/
form select#selectbox {
width: 100px;
height: 50px;
background-image: url('https://www.google.com/images/nav_logo101.png');
}