Files
textual/docs/styles/offset.md
2022-07-31 16:21:42 +01:00

31 lines
482 B
Markdown

# Offset
The `offset` rule adds an offset to the widget's position.
## Example
=== "offset.py"
```python
--8<-- "docs/examples/styles/offset.py"
```
=== "Output"
```{.textual path="docs/examples/styles/offset.py"}
```
## CSS
```sass
/* Move the widget 2 cells in the x direction, and 4 in the y direction. */
offset: 2 4;
```
## Python
```python
# Move the widget 2 cells in the x direction, and 4 in the y direction.
widget.styles.offset = (2, 4)
```