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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -