Click here to Skip to main content
12,400,948 members (62,012 online)
Click here to Skip to main content

Stats

53.3K views
580 downloads
20 bookmarked
Posted

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.
.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

You may also be interested in...

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