The CSSStyleSheet.insertRule() method inserts a new CSS rule into the current style sheet, with some restrictions.
public long InsertRule(string rule, int index)
|rule||String||A String containing the rule to be inserted. What the inserted rule must contain depends on its type:|
|index||Int32||A positive integer less than or equal to stylesheet.cssRules.length, representing the newly inserted rule’s position in CSSStyleSheet.cssRules. The default is 0.|
The newly inserted rule’s index within the stylesheet’s rule-list.
CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.
CSS Working Group - The CSS Working Group is the W3C working group chartered to develop Cascading Style Sheets (CSS).CSS Object Model (CSSOM) - CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.CSS Object Model (CSSOM) # dom-cssstylesheet-insertrule – The CSSOM definition.