A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/css/cssom/styleSheet/insertRule below:

insertRule · WebPlatform Docs

insertRule Summary

Adds a new CSS rule to the stylesheet.

Method of css/cssom/styleSheetcss/cssom/styleSheet

Syntax
var index = stylesheet.insertRule(ruleText, index);
Parameters ruleText
Data-type
String

The at-identifier ("@rule_name") and the rule content.

index
Data-type
Number

The index within the style sheet’s rule list of the rule before which to insert the specified rule. If the specified index equals the length of the style sheet’s rule list, the rule will be added to the end of the style sheet.

Return Value

Returns an object of type NumberNumber

The newly inserted rule’s index within the style sheet’s rule list.

Notes

After the new rule has been inserted, it becomes part of the cascade.

Related specifications
DOM Level 2 Style
Recommendation
See also Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4