791Chapter 30 .Style Sheet and Style Objects appended (Web hosts)

791Chapter 30 .Style Sheet and Style Objects appended to the end of rules in the styleSheet object. Or you can specify an integer as the index of the position within the rules collection where the rule should be inserted. The order of rules in a styleSheet object can influence the cascading order of overlapping style sheet rules (that is, multiple rules that apply to the same elements). The value returned by the method is an integer representing the index position of the new rule within the rules collection of the styleSheet. If you need subsequent access to the new rule, you can preserve the value returned by the addImport() method and use it as the index to the rulescollection. Related Items: addRule() method. addRule( selector , styleSpec [, index]) removeRule(index) Returns: Integer (for addRule()). NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . The addRule() method appends or inserts a style sheet rule into the current styleSheet object. The first two parameters are strings for the two components of every rule: the selector and the style specification. Any valid selector, including multiple, space-delimited selectors, is permitted. For the style specification, the string should contain the semicolon-delimited list of style attribute:value pairs, but without the curly braces that surround the specification in a regular style sheet rule. If you omit the last parameter, the rule is appended to the end of the rules collection for the style sheet. Or, you can specify an integer index value signifying the position within the rules collection where the new rule should go. The order of rules in a styleSheet object can influence the cascading order of overlapping style sheet rules (meaning multiple rules that apply to the same elements). The return value conveys no meaningful information. To remove a rule from a styleSheet object s rulescollection, invoke the removeRule() method. Exercise some care here, because you must have the correct index value for the rule that you want to remove. Your script can use a for loop to iterate through the rules collection, looking for a match of the selectorText property (assuming that you have unique selectors). The index for the matching rule can then be used as the parameter to removeRule(). This method returns no value. For NN6, the corresponding methods are called insertRule()and deleteRule(). On the CD-ROM Example on the CD-ROM Related Items: deleteRule(), insertRule() methods. styleSheetObject.addRule()
We recommend high quality webhost to host and run your jsp application: christian web host services.

Leave a Reply