Click here to Skip to main content
15,881,803 members
Articles / Web Development / HTML

How to change an input style with CSS

Rate me:
Please Sign up or sign in to vote.
2.25/5 (6 votes)
15 Feb 2012CPOL 61.1K   612   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.
.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)


Written By
Web Developer
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions