1

I have a doubt do css rules in external stylesheet get overridden by the embedded or inline css rules even if they have higher specificity.

//external stylesheet
p { color: blue !important; }
//inline css rule
p#test { color:red; }
Anand
  • 610
  • 6
  • 13

1 Answers1

0

No important will lock the style completely (unless you use !important again somewhere to override), so you cant override it with inline style

Marvin Fischer
  • 2,552
  • 3
  • 23
  • 34
  • 1
    Of course, !important should be avoided wherever possible, as it is difficult to override and works outside the normal cascade. But one of its valid uses is to override inline styles in plugins etc where you maybe can't get at the code directly - in which case it would be exactly as done here; the blue colour would override the inline red colour. – GuyH Nov 21 '14 at 12:51