开发者

IE 7, Chrome 10 & Opera 11 don't support css backgrounds for select fields - options?

I am using the simple css code below for a select field & it works in all browsers that I have tested apart from IE7, Chrome 10 & Opera 11.

background: url(../images/standard-select-bg.png) no-repeat;

What are 开发者_如何学Gomy options for those browsers?


For single item select:

  • With background-color: transparent, Firefox shows image, Chrome and Opera doesn't.
  • With background-color: rgba(0,0,0,0), all browsers show image.

For multiple item select:

  • Opera shows image only when using background-color: rgba(0,0,0,0), Firefox and Chrome shows in all cases.

Working at least in Opera 11.10beta


As far as I know, it's simply not possible in IE7 or Opera 11.

Choices:

  • Forget about the background-image in those browsers.
    • Neither has a massive amount of market share. It is worth spending extra time on them for a minor cosmetic effect?
  • Use JavaScript to replace the <select> elements with a "fake version".
    • You can style this however you like.
    • For example, Emblematiq Niceforms or jqTransform or the Uniform plugin.
    • It's quite a lot of extra work.

Unless the background-images are essential, I'd go with Option #1.


my site is http://arpitk.me.pn/ and it's background images didn't loaded too in chrome but it showed fine on firefox so i fixed it by using html {length:100%;} in css file and it loaded fine in chrome but ie and opera lags it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜