View Full Version : Resolved Drop down list text colour?

11-13-2010, 06:21 PM
Can I change the colour of the text in a drop down list? Or to be more precise can I change the colour of ONE of the items in the list?

Cheers Dan.

Chris Hick
11-13-2010, 09:23 PM
Of course, you can. Just add an id or class to your option tag. Here let me give you an example. Then style it in your css.


<style type="text/css">
#red {
color: red;
#blue {
color: blue;
.green {
color: green;

<select name="country">
<optgroup label="Africa">
<option value="gam" id="red">Gambia</option>
<option value="mad" id="blue">Madagascar</option>
<option value="nam" class="green">Namibia</option>
<optgroup label="Europe">
<option value="fra" class="green">France</option>
<option value="rus" class="green">Russia</option>
<option value="uk" class="green">UK</option>
<optgroup label="North America">
<option value="can">Canada</option>
<option value="mex">Mexico</option>
<option value="usa">USA</option>


Make sure to always validate @ http://validator.w3.org/ :thumbsup:

11-14-2010, 12:52 PM
That is awesome, thanks.

Chris Hick
11-14-2010, 03:11 PM
:thumbsup: You are welcome. Just remember to edit your first post and set it to resolved.