CSS background-image issue for <select> & <option>

对着背影说爱祢 提交于 2019-11-28 12:46:29

Its not that easy to change form element's style.. each browser has it's own way to render and create those elements. Some browsers will accept having a background image inside your select, others won't.

A simple technique is to add a default color, so the browser will render the color if it cant render the image.

background: #c3c3c3 url(http://www.3dtuning.ru/img/design/gallery-back.png) repeat-x 0 0;

so this way, firefox users will see a background image (something that always looks ugly, in my opinion) and the rest of the browsers will display with a gray background.

Hope this helps

Your alpha transparency is set to 0 in the RGBa values, this means that it will be completely transparent/not visible, this needs to be set to 1 for it to be visible.

Also, you need to put your RGBa value before the url('image.jpg').

Like the previous post: color comes before image url. in stead of rgba(0,0,0,0) you better use the word "transparent", as that would be better compatible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!