Adding stylesheet to tab

Which styles take precedence when you add a stylesheet to a tab? I found this link for safari extensions saying that

injected style < page style < page style !important < injected style !important

Is this the same in firefox? Does this mean I should add !important to my style definitions if I want it to override page styles?

https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/AddingStyles/AddingStyles.html

The order of stylesheet cascading is well-defined:
https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade#Cascading_order

So the question becomes how are you injecting your new sheet? It is possible to apply stylesheets as user agent, author, or user. You’re probably not using the stylesheet service, but it has a good description:
https://developer.mozilla.org/en-US/docs/Using_the_Stylesheet_Service

1 Like