Click here to Skip to main content
Click here to Skip to main content

How to change an input style with CSS

By , 15 Feb 2012
 

Sample Image - CSS_focus_color_change.gif

Introduction

This simple, short article will explain how to create an attractive and useful web form using CSS only. No javascript knowledge is required because not one javascript line is needed. Not a single one!

To start, just create the style you want, name it, then copy the style but in the name add ":focus" and that's all. After creating the CSS, then create the HTML form, link the CSS file, and add to the form whatever fields you want and assign them the style you just made. That's all, nothing else is needed.

To see it in action, download the fully editable example file.

That's all for now.

Regards from Argentina.

License

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

About the Author

luciannil
Web Developer
Argentina Argentina
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 2memberEdward Keningham10-Aug-12 6:58 
Adding a bit more would have been better
QuestionDidn't you test in IE6 before posting this article?membertcurtin7-Nov-06 8:01 
Generaldoes not work with my IE6membermikedepetris6-Nov-06 23:07 
GeneralRe: does not work with my IE6membermikedepetris7-Nov-06 0:11 
GeneralRe: does not work with my IE6membertcurtin7-Nov-06 7:48 
GeneralRe: does not work with my IE6membermikedepetris7-Nov-06 7:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

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