Click here to Skip to main content
11,706,799 members (48,181 online)
Click here to Skip to main content
Add your own
alternative version

How to change an input style with CSS

, 15 Feb 2012 CPOL 52K 571 20
This article describes how to use CSS to change any form field's style: color, border color, border line with, height, width, etc... when it's on focus. Works in IE & Mozilla.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="">

  <title>CSS Form field color change... on focus... By Luciano D. Iannicelli</title>
<link rel="stylesheet" href="css_color_change.css" type="text/css" media="screen"  />

<table width="580" border="0" cellspacing="0" cellpadding="2">
                  <td  colspan="3">
                  <hr align="center" noshade="noshade" size="1" color="#C0C0C0" />
					<td width="200" valign="top">
					<input class="combo" type="text" name="nom" size="22" /><br>
					<input class="combo" type="text" name="ape" size="22" /><br>
					Telephone nr<br>
					<input class="combo" type="text" name="tel" size="22" /><br>
					<input class="combo" type="text" name="ema" size="22" /><br>
					<td width="180" valign="top" align="left">Comment<br>
					<textarea class="campo" name="con" rows="8" cols="32" wrap="physical"></textarea>
                  <br><div align="right"><input class="button" type="submit" name="submitButtonName" value=" Send " /></div>
					<td width="200" valign="top" align="left">


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
Argentina Argentina
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150819.1 | Last Updated 15 Feb 2012
Article Copyright 2006 by luciannil
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid