1

bootstrap.css is overriding my style... How can I avoid this to happen? How can I force the css to load first?

One thing that is a problem is that the website where it needs to be is using @import to load the css files (this cannot be changed, the customer doesn't want to change that).

Any ideas?

***Note****

I cannot modify the current site at all. I just have to include bootstrap.css without overriding anything else. Is this possible?

nickhar
  • 19,981
  • 12
  • 60
  • 73
luqita
  • 4,008
  • 13
  • 60
  • 93
  • please see update, i cannot modify the current site. – luqita Mar 29 '13 at 17:58
  • watson, i flagged that comment for being offensive... Please limit yourself to answering the question. – luqita Mar 29 '13 at 18:00
  • In answer to your update. No it's not possible without modifying the site. at the very least you would have to change the order that the css style sheets are being called. If you can't even do that, then there is no possible way to fix your problem. – Ryan Mar 29 '13 at 18:05

2 Answers2

3

You need to write a more specific selector. Remember that ID has the most weight. You can temporarily mark it with !important to check if you are targeting it correctly.

If you are targeting a anchor in a list item for example then to overwrite the reset styles you can write something like nav ul li a{color: black;}

Juan Rangel
  • 1,763
  • 1
  • 18
  • 34
0

You simply have to increase the specificity of your rules. This means adding more to your selectors, say you have .elem { color: blue; }, you can make it .parent .elem { color: blue; }

Or using !important, like .elem { color: blue !important; }

dezman
  • 18,087
  • 10
  • 53
  • 91