View Full Version : Applying CSS to Specific Form Fields


Opv
07-26-2005, 03:00 PM
My object is to have text entered into specific form fields have a unique style applied, specifically a unique font color and background color.

How would the SPAN tag be used to apply to a specific form field name? OR, is there a more simple alternative to the SPAN tag?

Thanks,

Opv

lefty
07-26-2005, 04:25 PM
the span tag isn't too difficult to use (although if you use div instead, it's more cross-browser friendly).

In your css you can specify the alternate style, and name it whatever you want. It's a seperate category from everything else. (I'll just name it example)

.example {
font-weight:bold; }

or whatever (you can obviously add more than that). don't forget the . in the beginning :)

So around your text, it would look like this:
<div class="example">whatever text goes here</div>