class - CSS classes, order of precedence -


i stumbled on css issue don't understand. have parent class styles on element, , class on element which, in opinion, should overwrite parent class, doesn't:

<div class="parent">     <p>regular paragraph</p>     <p class="note">note paragraph</p> </div> 

css

.parent p {     font-size: 1.5em; } .note {     font-size: 90%; } 

i don't use ids instead of classes, , don't have important! anywhere in styles. understand can use "div" instead of "p" fix problem in case. try figure out why precedence works way.

specifying element along class give selector priority on parent definition. try setting p.note { instead.

http://jsfiddle.net/3zfoqtd4/


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -