tags:

views:

53

answers:

3

How can i apply two styles in the same field? One Name* field.I want to apply Name as one text color and * are another color.Can any one suggest.

+3  A: 

If I have understood you correctly, then CSS classes are what you need. They can be applied side-by-side for single item like this:

<input class="first1 second1"/>

You should note, that if you define same properties in both classes, only the last one will be applied.

If this doesn't clear up your question post some code, for more help.

mth
+4  A: 

I think you're asking for two different text colours within the same element - you can't do that. You need to add another element in there, for example:

<label for="first_name">Name<span>*</span></label>

label { color: blue; }
label span { color: red; }
Greg
Voting up cause you 99.9% understood the cryptic question :)
Roberto Aloi
A: 

You'll need some additional markup:

<label>Name <span class="required">*</span>
    <input type="text" name="name" value="" />
</label>

// CSS
label {
   color: green;
}

label .required {
   color: red;
}
PatrikAkerstrand