Applying font size to a div and selector priority for * tag
this may be a bit stupid, but I'm having a problem with the font size of
text inside a div.
In my CSS I have used
*{
font-size: 16px;
}
#newsletter{
font-size: 14px;
}
When I do this Chromes Element Inspector shows that it is using the 16px
from the * selector.
When I use
#newsletter p{
font-size: 14px;
}
That works, I know that It uses that because it is a more specific
selector, but why doesn't it pick up the 14px set to the #newsletter
selector, it is further down in the CSS so it should take priority, does
it not work because the * selector takes priority for some reason, or does
setting font-size on a div not work, does it have to be on the #newsletter
p selector instead.
No comments:
Post a Comment