GM_addStyle
From GreaseSpot
Contents |
[edit] Description
This method adds a string of CSS to the document.
It creates a new <style> element, adds the given CSS to it, and inserts it into the <head>.
Compatibility: Greasemonkey 0.6.1+
[edit] Syntax
function GM_addStyle( css )
[edit] Arguments
-
css -
StringA string of CSS.
[edit] Examples
GM_addStyle("body { color: white; background-color: black; } img { border: 0; }");
[edit] Notes
- Add
!importantat the end of a CSS declaration to override an existing value (i.e. values the page specifies). - Using Multi Line Strings may be helpful.