GM addStyle: Difference between revisions
From GreaseSpot Wiki
Jump to navigationJump to search
m →Syntax: Lost but not forgotten ;D |
mNo edit summary |
||
Line 26: | Line 26: | ||
:* All properties are optional except [[#css|css]]. | :* All properties are optional except [[#css|css]]. | ||
[[# | [[#top|top]] | ||
=== Properties === | === Properties === | ||
---- | ---- | ||
Line 33: | Line 33: | ||
:Usage: <code>'''css''' = "body { color:red }";</code> | :Usage: <code>'''css''' = "body { color:red }";</code> | ||
[[# | [[#top|top]] | [[#Syntax|back]]'' | ||
== Examples == | == Examples == | ||
Line 40: | Line 40: | ||
</pre></code> | </pre></code> | ||
[[# | [[#top|top]] | ||
== Notes == | == Notes == | ||
[[# | [[#top|top]] | ||
[[Category:API_Reference|G]] | [[Category:API_Reference|G]] |
Revision as of 09:20, 8 December 2007
Description
This API 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>
.
Syntax
GM_addStyle( css )
- Value: Function
- Returns: Nothing
- Compatibility: Greasemonkey 0.6.1+
Parameters Properties css
- All properties are optional except css.
Properties
css
- Value: String
- Usage:
css = "body { color:red }";
Examples
GM_addStyle("body { color:white; background-color:black } img { border:0 }");