views:

21

answers:

1

I have a situation where the .css in my head tag is getting overridden by css that's being inserted dynamically into the head by a javascript library.

The .js library automatically appends the new .css link to the end of the head tag so it is always put on top of my styles.

+2  A: 

You have several options:

  1. Use a different JavaScript library
  2. Make sure all your rules have a higher specificity than the ones added by the library
  3. Learn about !important
robertc
+1a quick note : CSS being added to the end of head, or added later by javascript doesn't cause it to be put 'on top of' other stylesheets. Style is applied according to specificity of the selector..
Ravindra Sane