Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 8th, 2004, 12:41 AM
Authorized User
 
Join Date: Jul 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to change the default color of select type?

There is a select example:

<SELECT name="test">
  <option value="1">red</option>
  <option value="2">blue</option>
</SELECT>

The default color of arrow is black and button of select is gray,I want to know if I can use style table to change the color of the arrow and button of select type? How to realize it?


 
Old May 8th, 2004, 04:19 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Edward,

I don't think you can change that; at least not with HTML or CSS. These colors are determined by the skin or chrome of the browser and OS.

If you really need this functionality, I think you'll have to create a custom solution with images and JavaScript.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 1st, 2004, 05:46 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Although you can't change the arrow, you can, on the other hand, style colors of the individual <option> elements.

<option value='1' style='background: red; color: red;'>red</option>
<option value='2' style='background: blue; color: blue;'>blue</option>

Styling the individual <option> elements isn't widely supported by older browsers, but it does work on newer browsers, best on Mozilla, partially on IE, although I'm pretty sure that IE supports both background and foreground color changes in this case.

HTH!


Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
change the text color of (<xsl:value-of select="De ismailc XSLT 2 August 25th, 2008 07:25 AM
re: color change jack_in_black ASP.NET 2.0 Professional 0 July 11th, 2006 07:24 AM
Change Cell Color phungleon HTML Code Clinic 2 April 9th, 2006 12:36 AM
change link color swastikagaur Classic ASP Basics 1 March 11th, 2005 10:35 PM
how to change all control color ashish2001mca .NET Framework 2.0 1 February 23rd, 2005 12:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.