Reputation: 5095
Here is the markup that I have
<div class="sign-in ">
<form>
<fieldset>
<p class="note">
Note
</p>
</div>
The CSS rule that one of my stylesheet has is this :
.sign-in p{
margin: 5px 80px;
}
I need this style rule to be overwritten for p tags that have a note class along with that.
SO I apply this style rule
.sign-in .note p{
margin:0px;
}.
However, the original style rule still sustains itself instead of being overridden by the new style rule that I have applied.
Here is this in js fiddle: http://jsfiddle.net/fNepf/
What am I doing wrong?
Upvotes: 0
Views: 157
Reputation: 59829
Your selector should instead be:
.sign-in p.note {
margin: 0px;
}
As the selector you posted is looking for a <p>
that is a descendant of an element with class .note
instead of a <p>
element with the class .note
If you have two classes on the <p>
you could use .sign-in p.note.test {}
:
Upvotes: 1