Click to See Complete Forum and Search --> : Can I change the colour of a Select Box?


screaming_banjo
01-14-2004, 06:08 AM
Hi

I have a drop down select box on one of my pages, I'm fairly certain that it's possible to change the background colour and text colour in these boxes, but I've not idea how.

I've tried:

form {
background-color: #FEFEE4;
color: #317B6B;
}

These are the colors I want to use, I made it red to see the difference and it's only the area around the box that changes colour. I'm sure I've seen this done somewhere before, but can't remember where!

Thanks in advance!

David Harrison
01-14-2004, 07:23 AM
Try this:

<style type="text/css"><!--

form select option{
background-color: #FEFEE4;
color: #317B6B;
}

--></style>

screaming_banjo
01-14-2004, 07:49 AM
Thank you so much, working like a charm!

David Harrison
01-14-2004, 11:40 AM
Happy to help. :)

What use would styling the input element do? He's using select and option elements.