CSS !important not working

Give the <div> an id and then add this rule to your CSS stylesheet (or in a <style> tag if you don’t want to change the style sheet):

#your_div_id span {
    font-family : calibri; font-size: 20pt !important;
}

!important in CSS allows the author to override inline styles (since they have a higher precedence than style sheet styles normally). It doesn’t automatically make the style marked !important override everything else.

SEE: The W3C’s documentation on CSS Selector Specificity.
Felix’s Demo of the markup

Leave a Comment