css - Can I change the background of select box options to that of a image pattern? -


If using a png pattern, I can easily change the background of the selection box:

  Select background (url (path / to / some / image.png);}  

The same thing will not work for the options of that selection box. For example, I can give them a background-color: red; , but I want to use a pattern (the same as selection, in fact).

Options {Background : URL (path / to / some / image page); / * will not work / background color: red; / * will work * /}

My impression is that this is not possible But I am not getting any evidence of this, and I hope it is (somehow). Suggestion:

It is not easy (or I want to say impossible) to change the background image of an option element properly because every browser presents it differently if you have a If you want to go with a pure CSS solution then I think the best way to provide a fallback to the browser is that you can do a simulation of an element using a JavaScript plugin (like).

Do not accept background images on optional elements:

  background: #red url (path / to / some / image.png) repeat x 0 0;  

Comments