Styling one line of a select menu different from others?

Hello all,

I’m hoping to be able to color one line of a select menu red with the other selections blue. How would I do it? I can modify the colors of all the selections by using select, but have been unable to change the color of just one selection “line”

Here is my code:

<select name=“tld” id=“style” class=“tld”>
<option value=“.ca”>.ca</option>
<option value=“.com”>.com</option>
<option value=“.net”>.net</option>
</select>

Any help is appreciated.

Don’t want the inline style technique, being bad practice and all. Any other answers?

what do you mean by one selection? Just an option element? Then at least in modern browser you could do that by adding a style like <option style=“color:#f45324”>Label</option>. Offcourse, is not a good practice to use inline styles… i just wana be quick

it’s only static (that line remains always red), or changes dynamically, like the current selection from the list? (and this is probably a css thread post :slight_smile: )

Why not use an id or class?

Exactly the same way that you would style any other element that you wanted to be different from the norm…