CSS Selector not working on elements within a div
I have the following HTML structure:
<div class="formFields">
<label> Field 1: </label>
<input type="text" value="" name="field1" />
</div>
And my CSS selectors are as follows:
#formFields {clear:bot开发者_JAVA百科h;}
#formFields label {font-weight:bold;}
The clear:both;
is being applied to the div, but the font-weight:bold;
is not being applied to the labels. How would I apply this font-weight
to the labels?
At the moment, none of the rules is being applied to the div.
#
is the ID selector.
would be the class selector
so you'll either have to give the rules the class selector
.formFields
or give the div the ID formFields
:
<div id="formFields">
精彩评论