
## insert_rule {#str-int}

Used to insert a new rule into the media block.


### Returns 


The inserted index.


```python
def insert_rule(self, rule, index):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| rule | str | The media rule. |
| index | int | The index. |



### See Also
* module [`aspose.html.dom.css`](../../)
* class [`ICSSMediaRule`](/html/python-net/aspose.html.dom.css/icssmediarule)
