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]].


[[#Description|top]]
[[#top|top]]
=== Properties ===
=== Properties ===
----
----
Line 33: Line 33:
:Usage: <code>'''css''' = "body { color:red }";</code>
:Usage: <code>'''css''' = "body { color:red }";</code>


[[#Description|top]] | [[#Syntax|back]]''
[[#top|top]] | [[#Syntax|back]]''


== Examples ==
== Examples ==
Line 40: Line 40:
</pre></code>
</pre></code>


[[#Description|top]]
[[#top|top]]


== Notes ==
== Notes ==
[[#Description|top]]
[[#top|top]]


[[Category:API_Reference|G]]
[[Category:API_Reference|G]]

Revision as of 09:20, 8 December 2007

Template:Underscore


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>.

Examples | Notes

Syntax

GM_addStyle( css )

Value: Function
Returns: Nothing
Compatibility: Greasemonkey 0.6.1+
Parameters
Properties
css
  • All properties are optional except css.

top

Properties


css

Value: String
Usage: css = "body { color:red }";

top | back

Examples

GM_addStyle("body { color:white; background-color:black } img { border:0 }");

top

Notes

top