Textbox highlight color html

Does anyone know how to change the highlight color in a textbox on a webpage ?  Standard highlight colors are dark blue background and white text.  I would like to be able to modify these if possible.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I know of no way to do this with CSS. Highlight colors are controlled by the operating system and maybe the browser. You might try changing the color of the font to see if the highlight color changes, or change the background of the text box, but that is not the same thing.
With a little JavaScript and CSS you could do this.  In this page if you enter text in the field and select it it will change colors.


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>New Page 1</title>
<script type="text/javascript">
function changeColor(oFld) {
      oFld.style.color= "#FFFFFF";
      oFld.style.backgroundColor = "#000088";



<p><input type="text" name="T1" size="20" onselect="changeColor(this)"></p>



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cannonarmAuthor Commented:
Sorry rdivilbiss, that code does change colors of the text box and text , but I could not control the highlight colors with that code.  I have to give credit to Zyloch, I do not think it can be done with CSS.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Works in IE, FF, & Opera...

Here is a live example with screen shots.

Changing the background color of the field is similar to, but not exactly the same as changing the highlight color, unless I'm mistaken.
What the fore, and back colors are directly affect the highlight (selected) color in almost all browsers.  I'm just setting them temporarily (while selected) to get the desired effect.  It isn't always easy to determine what highlight colors you'll get from a given set of fore and back colors.  It may or may not be feasible for the asker's intent, and it is very limited.  Just not impossible.

I see I forgot the link above: http://www.rodsdot.com/temp_testing/highlight-text-on-select.htm
I have only really seen two different highlight colors--the navy and the white, but I see your point.
I would never do this on a production web site.

I hate colored scroll bars and inputs.
no opinion
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.