Reputation: 3502
I have this defined in an existing CSS sheet that I'm working with:
label.error-field
To assign this to an html element do I simply do class="error-field"
or do I add the label to have it be class="label.error-field"
?
Upvotes: 0
Views: 209
Reputation: 179046
label.error-field
will select an element label
with a class of error-field
<label class="error-field">...</label>
Upvotes: 3
Reputation: 49188
This will only work on labels
.
<label class="error-field">I'm an error label, yo ho ho</label>
The label.
part is a CSS type (element) selector with a class (.
) selector.
Upvotes: 3
Reputation: 30002
label.error-field
is only applied to <label>
elements with the class "error-field
".
So if you want it on a label
, then you'd just assign the class
as "error-field
", like this:
<label class="error-field">
Upvotes: 4