treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Style Override Technique

Last updated on:

p { 
   font-size: 24px !important; 
}

The !important rule at the end of a value will override any other style declarations of that attribute, including inline styles.

Reference URL

View Comments

Comments

  1. Permalink to comment#

    Wow… I learn new thing here… TQ for the snippet..

  2. Chris

    It’s evil!!!
    Code clean and you dont have to do this.

  3. Joachim
    Permalink to comment#

    Chris, it’s not evil but sometimes neccessary. Imagine you use something like Joomla and need to chnage CSS styles of a module. If they update the module all is gone. But if you extract the styles you want to edit and “import” them, you can attach your onw CSS with the changes and most times you will have no trouble updating :)

Leave a Comment

Use markdown or basic HTML and be nice.