Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

How to change an input style with CSS

, 15 Feb 2012 CPOL
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.
css_color_change.zip
css_focus_color_change_demo.zip
css_focus_color_change_src.zip
.button {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #e8e8e8;
     background-position : center;
     width : 80px;
     height : 21px;
     border : 1px solid #707070;
      }

.button:focus {
     font-size : 12px;
     font-family : "trebuchet ms",Verdana, Arial, Helvetica, sans-serif;
     line-height : 15px;
     background-color : #ffa8a8;
     background-position : center;
     width : 80px;
     height : 21px;
     border : 1px solid #707070;
      }

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.

License

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

Share

About the Author

luciannil
Web Developer
Argentina Argentina
No Biography provided

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