Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Color With CSS

Status
Not open for further replies.

Tezdread

Technical User
Oct 23, 2000
468
0
0
GB
Hello, I am trying to change the color of a drop down menu, I guess it would be done with CSS because i can't do it another way.

This is what I have so far:

<select name=&quot;Domain Types&quot; style=&quot;background-color: rgb(0,0,0); color: rgb(255,0,0); border-left: 1px solid rgb(0,180,0); border-right: 1px solid rgb(0,180,0); border-top: 1px solid rgb(0,180,0); border-bottom: 1px solid rgb(0,180,0)&quot;>
<option>.co.uk</option>
<option>.uk.co</option>
<option>.uk.com</option>
</select>

But I can't get the grey border, button and arrow to change color? I would like it to match these.

<input type=&quot;text&quot; name=&quot;textfield&quot; maxlength=&quot;65&quot; value=&quot;Your Domain Name&quot; size=&quot;17&quot; style=&quot;background-color: rgb(0,0,0); color: rgb(255,0,0); border-left: 1px solid rgb(0,180,0); border-right: 1px solid rgb(0,180,0); border-top: 1px solid rgb(0,180,0); border-bottom: 1px solid rgb(0,180,0)&quot;>

And:

<INPUT TYPE=&quot;SUBMIT&quot; VALUE=&quot;Submit&quot; style=&quot;background-color: rgb(0,0,0); color: rgb(255,0,0); border-left: 1px solid rgb(0,180,0); border-right: 1px solid rgb(0,180,0); border-top: 1px solid rgb(0,180,0); border-bottom: 1px solid rgb(0,180,0)&quot;>

Thanks in advance hope we can get it sorted.
 
Hello,

unfortunately I dont think its possible to &quot;change&quot; the color of the outline and arrow portions of a drop down menu, and actually, changing the background color doesnt always work in netscape. however, you could always recreate the dropdown menu in flash and that way you could do it anyway you please, in any color.

hope this helps!

laters!

hoolz who?
 
You can use style functions with <select>, but Netscape won't render them. To get the styles to work for a background use &quot;background-color: #ff0000&quot; in <style> or in the <select> tag:

<seclect style=&quot;background-color: #ff0000&quot;>

To change font colors in the options you have to apply a <style> to each <option>. You can't just put it in the <select> tag's style (rats). I use classes to save typing(I'm lazy):

<option class=&quot;red&quot;>stuff.

I've got an example of how nice this can make a drop-down menu look at Make sure to view the page in IE to see the <style> effects. Feel free to borrow any source you want.

Code Punk
code_punk@hotmail.com
 
You can use scrollbar-face-color, scrollbar-arrow-color, scrollbar-base-color, scrollbar-shadow-color, scrollbar-dark-shadow-color, scrollbar-highlight-color and scrollbar-3d-light-color properties. But they only supported in IE5.5B1. You can get more information at

Michael Dubner
Brainbench MVP/HTML+JavaScript

 
You can use scrollbar-face-color, scrollbar-arrow-color, scrollbar-base-color, scrollbar-shadow-color, scrollbar-dark-shadow-color, scrollbar-highlight-color and scrollbar-3d-light-color properties. But they only supported in IE5.5B1. You can get more information at

Michael Dubner
Brainbench MVP/HTML+JavaScript

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top