Solved

Color for <select> and <input type=text>

Posted on 2003-11-26
6
243 Views
Last Modified: 2010-04-06
<select> and <input type=text> would draw their buttons with Windows button color whatever the style of my web page. The same is true for <select> scrollbar and borders. <input type=radio> and <input type=checkbox> have Windows background color and border color, too.
Is there any trick to change that? The solution should work for IE, I don't care about other browsers.
0
Comment
Question by:Vihmapuu
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:Vihmapuu
ID: 9824109
Oops, please replace <input type=text> with <input type=file>. Text box shows the styles OK but the file upload input has a button that does not honor my styles. Sorry for that.
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 9829171
This example shows how to change the background and border color of a select and file input. It also shows how to change the background color of a radio button and checkbox. Radio buttons and checkboxes cannot change border colors and you cannot customize the actual button of the file input.

<html>
<head>
<style type=text/css>
.redbg {background: red; border-color:green;}
</style>
</head>
<body>
Select
<br>
<select class=redbg>
<option>Option 1
<option>Option 2
<option>Option 3
<option>Option 4
<option>Option 5
</select>
<br>
<br>
Checkbox
<br>
<input type=checkbox class=redbg>
<br>
<br>
Radio Button
<br>
<input type=radio name=radio1 value="1" class=redbg>
<br>
<br>
File Input
<br>
<input type=file class=redbg
</body>
</html>

Online version:
http://timbo87.home.comcast.net/temp/redbg.htm
0
 
LVL 1

Author Comment

by:Vihmapuu
ID: 9830269
Well, thank you but there is nothing new in what you wrote.
That's easy stuff and that is not why I offered 500 points.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:Timbo87
ID: 9832419
Your question is a bit vague. The background colors are changed, per your request. Can you tell me exactly what you want?
0
 
LVL 1

Author Comment

by:Vihmapuu
ID: 9841606
I want to change
<select> scrollbar and button color
<select> border color
<input type=file> button color
<input type=radio> inside background and border color
<input type=checkbox> inside background and border color
0
 
LVL 4

Accepted Solution

by:
daluu earned 500 total points
ID: 9844225
i wonder if this can be done. probably requires some javascript or vbscript too in addition to CSS.
ASP.NET and Visual Studio might give you more control over those too, but i don't know.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
In addition to being a great web-based presentation tool, Prezi also makes it easy to save your presentation as a PDF to share with others as well. Learn how in this tutorial. Select the share icon from the top menu in your Prezi editor: Select "D…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now