选择(下拉)的背景图像在 Chrome 中不起作用 [英] Background Image for Select (dropdown) does not work in Chrome

查看:28
本文介绍了选择(下拉)的背景图像在 Chrome 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用图片作为选择/下拉菜单的背景.以下 CSS 在 Firefox 和 IE 中运行良好,但在 Chrome 中不起作用:

I want to use an image for the background of a select/dropdown. The following CSS works fine in Firefox and IE, but does not in Chrome:

#main .drop-down-loc { width:506px; height: 30px; border: none; 
  background-color: Transparent; 
  background: url(images/text-field.gif) no-repeat 0 0; 
  padding:4px; line-height: 21px;}

推荐答案

select 
{
    -webkit-appearance: none;
}

如果需要,您还可以添加包含箭头的图像作为背景的一部分.

If you need to you can also add an image that contains the arrow as part of the background.

这篇关于选择(下拉)的背景图像在 Chrome 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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