Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2012 Google Inc.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package elemental.css;
import  elemental.css.*;

An object implementing the CSSRule DOM interface represents a single CSS rule. References to a CSSRule-implementing object may be obtained by looking at a CSS style sheet's cssRules list.

There are several kinds of rules. The CSSRule interface specifies the properties common to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types.

public interface CSSRule {
    static final int CHARSET_RULE = 2;
    static final int FONT_FACE_RULE = 5;
    static final int IMPORT_RULE = 3;
    static final int MEDIA_RULE = 4;
    static final int PAGE_RULE = 6;
    static final int STYLE_RULE = 1;
    static final int UNKNOWN_RULE = 0;
    static final int WEBKIT_KEYFRAMES_RULE = 7;
    static final int WEBKIT_KEYFRAME_RULE = 8;


  
Returns the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }"
  void setCssText(String arg);


  
Returns the containing rule, otherwise null. E.g. if this rule is a style rule inside an @media block, the parent rule would be that CSSMediaRule.
Returns the CSSStyleSheet object for the style sheet that contains this rule
One of the Type constants indicating the type of CSS rule.
  int getType();
New to GrepCode? Check out our FAQ X