Click to See Complete Forum and Search --> : Color in drop down menu?


EetieD
11-13-2003, 08:25 AM
Hello,

Is it possible in HTML to use colors for text in a 'drop down menu'? If not, in which language (maybe DHTML) is it possible?

Thanks in advance.

Robert Wellock
11-13-2003, 10:24 AM
Yes, use CSS for example:

<style type="text/css">
<!--
select { background-color: red; color: white;}
-->
</style>

EetieD
11-14-2003, 09:29 AM
Thanks for the reply. But actually that is not what I mean. Is it possible to use several colors for each item of the drop down menu?

Hope someone can help me. Thanks in advance.

DaveSW
11-14-2003, 09:34 AM
This works in IE6

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<div><select>
<option style="color: #3300ff;">hello</option>
<option style="color: #66ff33;">hello</option>
<option style="color: #666666;">hello</option>
<option style="color: #ff3333;">hello</option>
<option style="color: #669966;">hello</option>
</select></div>
</body>
</html>

And it's CSS, like Rob's solution.

DaveSW
11-14-2003, 09:37 AM
Or do you mean each letter different colors?

EetieD
11-17-2003, 10:35 AM
Yes, your code helped me with my problem (to have different colors for each item of the drop down menu). Thanks a lot!