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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different colors in forms

Status
Not open for further replies.

Snive

Programmer
Jun 10, 2003
5
CA
I've got a drop down menu for a navigator...I don't want to use a DHTML script as I don't want the drop down to be dynamic. I do however want the color scheme to match that of my webpage. Is it possible to change the colors of an HTML based drop down menu?

See the navigator bar on the left hand side of the screen:
 
<select style=&quot;background-color: yellow;&quot;>

Or you can give it a class...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
What about the scrollbar color and text colors? Can those be changed?
 
I'm not sure about the arrow, but I believe it can be changed. As for the text color...

<select style=&quot;background-color: yellow; color:red;&quot;>
<option> test option
<option>another
</select>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I Hope this helps

body {SCROLLBAR-FACE-COLOR: #FF9933;
SCROLLBAR-HIGHLIGHT-COLOR: black;
SCROLLBAR-SHADOW-COLOR: #EB9F13;
SCROLLBAR-ARROW-COLOR: white;
SCROLLBAR-BASE-COLOR: #FF9933
scrollbar-3d-light-color: red;
scrollbar-dark-shadow-color: purple;}
 
I'm pretty sure scrollbars and arrows on selects can't be changed.

Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) && (((parseInt(Math.abs(x).toString()+Math.abs(y).toString())-Math.abs(x)-Math.abs(y))%9)!=0)) {alert(&quot;I'm a monkey's uncle&quot;);}
 
I've never actually changed the arrows myself, so no guarantees, but try this (the example is for a text area I don't know if it can be applied to a drop down -comboBox-, by the above posts it looks like it can't - it might be worth a try):

First you need to create a CSS(Cascading Style Sheet). Open a regular text document (use notepad for example) and insert this code (modify the colours to suit your needs):


textarea {
scrollbar-base-color: #008000;
scrollbar-arrow-color: #e0e222;
}


Save it as stylefile.css

To load a style file in your webpage use this line in your html code:

<LINK REL=&quot;stylesheet&quot; HREF=&quot; TYPE=&quot;text/css&quot;>

Be sure you upload the CSS file to the correct directory.

The following is a CSS generator (it may be helpful as well):



You should also be able to do this from your html code using the following line of code:

<select style=&quot;scrollbar-base-color: #008000; scrollbar-arrow-color: #e0e222;&quot;>

**not so sure about this one but give it a try
**For your drop down box in the CSS try replacing the word textaea with combobox
 
also can style options:

<style type=&quot;text/css&quot;>
c1{color:#900;background:#9ff;}
c2{color:#090;background:#f9f;}
</style>

<select>
<option class=&quot;c1&quot;>Option 1</option>
<option class=&quot;c2&quot;>Option 2</option>
</select>

News and views of some obscure guy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top