Do you have multiple font colors in the selection box?

Is it possible to have an HTML select box in which the OPTION text has different colors?

<select>
<option>Black_text (yellow_text)</option>
</select>

I tried using the CSS SPAN element to color the text, but this does not work.

Any ideas?

UPDATE: Note. I am trying to have multiple font colors on the same OPTION line. I have seen quite a few tutorials on how to style the entire OPTION line, but I'm trying to style the elements in the same parameter line.

+5
source share
4 answers

Try the style of the elements option:

<option style="…">Label</option>

But I doubt that browsers support many styles of these elements.


Edit

OPTION.

, option :

<!ELEMENT OPTION - O (#PCDATA)         -- selectable choice -->
+6

, . , , Javascript + HTML + CSS, " ", div span, onclick onmouseover javascript. , , .

+3

:

<option style="background-image: multicolorimage.jpg>some text</option>

, . , , :)

0
source

No, but you can use things like http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/ , which creates its own selectbox using span tags and tags.

0
source

All Articles