CSSMediaRule
Overview
CSSMediaRule is a class in Aspose.Html FOSS for Python.
Inherits from: CSSRule.
Media rule scaffold for nested style rules.
This class provides 3 methods for working with CSSMediaRule objects in Python programs.
Available methods include: __init__, delete_rule, insert_rule.
All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package.
Properties: CHARSET_RULE, COUNTER_STYLE_RULE, FONT_FACE_RULE, FONT_FEATURE_VALUES_RULE, IMPORT_RULE, KEYFRAMES_RULE, and 16 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
type | int | Read | Gets the type. |
condition_text | str | Read | The media condition as a string (CSSOM §6.8.1 alias for media_text). |
css_text | str | Read | Gets the css text. |
media_text | `` | Read | Gets the media text. |
css_rules | `` | Read | Gets the css rules. |
UNKNOWN_RULE | int | Read | Gets the unknown rule. |
STYLE_RULE | int | Read | Gets the style rule. |
CHARSET_RULE | int | Read | Gets the charset rule. |
IMPORT_RULE | int | Read | Gets the import rule. |
MEDIA_RULE | int | Read | Gets the media rule. |
FONT_FACE_RULE | int | Read | Gets the font face rule. |
PAGE_RULE | int | Read | Gets the page rule. |
KEYFRAMES_RULE | int | Read | Gets the keyframes rule. |
KEYFRAME_RULE | int | Read | Gets the keyframe rule. |
NAMESPACE_RULE | int | Read | Gets the namespace rule. |
COUNTER_STYLE_RULE | int | Read | Gets the counter style rule. |
SUPPORTS_RULE | int | Read | Gets the supports rule. |
FONT_FEATURE_VALUES_RULE | int | Read | Gets the font feature values rule. |
LAYER_BLOCK_RULE | int | Read | Gets the layer block rule. |
LAYER_STATEMENT_RULE | int | Read | Gets the layer statement rule. |
parent_style_sheet | CSSStyleSheet | None | Read | Gets the parent style sheet. |
parent_rule | CSSRule | None | Read | Gets the parent rule. |
Methods
| Signature | Description |
|---|---|
__init__(media_text: str) | Calls init(media_text) on this CSSMediaRule instance. |
insert_rule(rule_text: str, index: int | None) → int | Insert a nested style rule and return its index. |
delete_rule(index: int) | Delete a nested rule at index. |