65.9K
Home

How to change an input style with CSS

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.25/5 (6 votes)

Nov 1, 2006

CPOL
viewsIcon

62534

downloadIcon

616

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.

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.