mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update reference for content align rule.
This commit is contained in:
@@ -3,35 +3,34 @@
|
|||||||
The `content-align` style aligns content _inside_ a widget.
|
The `content-align` style aligns content _inside_ a widget.
|
||||||
Not to be confused with [`align`](../align).
|
Not to be confused with [`align`](../align).
|
||||||
|
|
||||||
You can specify the alignment of content on both the horizontal and vertical axes at the same time,
|
|
||||||
or on each of the axis separately.
|
|
||||||
|
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
```
|
--8<-- "docs/snippets/syntax_block_start.md"
|
||||||
content-align: <HORIZONTAL> <VERTICAL>;
|
content-align: <a href="../css_types/horizontal.md"><horizontal></a> <a href="../css_types/vertical.md"><vertical></a>;
|
||||||
content-align-horizontal: <HORIZONTAL>;
|
|
||||||
content-align-vertical: <VERTICAL>;
|
content-align-horizontal: <a href="../css_types/horizontal.md"><horizontal></a>;
|
||||||
```
|
content-align-vertical: <a href="../css_types/vertical.md"><vertical></a>;
|
||||||
|
--8<-- "docs/snippets/syntax_block_end.md"
|
||||||
|
|
||||||
|
The style `content-align` takes a [`<horizontal>`](../css_types/horizontal.md) followed by a [`<vertical>`](../css_types/vertical.md).
|
||||||
|
|
||||||
|
You can specify the alignment of content on both the horizontal and vertical axes at the same time,
|
||||||
|
or on each of the axis separately.
|
||||||
|
To specify content alignment on a single axis, use the respective style and type:
|
||||||
|
|
||||||
|
- `content-align-horizontal` takes a [`<horizontal>`](../css_types/horizontal.md) and does alignment along the horizontal axis; and
|
||||||
|
- `content-align-vertical` takes a [`<vertical>`](../css_types/vertical.md) and does alignment along the vertical axis.
|
||||||
|
|
||||||
### Values
|
### Values
|
||||||
|
|
||||||
#### `HORIZONTAL`
|
#### <horizontal>
|
||||||
|
|
||||||
| Value | Description |
|
--8<-- "docs/snippets/type_syntax/horizontal.md"
|
||||||
| ---------------- | -------------------------------------------------- |
|
|
||||||
| `left` (default) | Align content on the left of the horizontal axis |
|
|
||||||
| `center` | Align content in the center of the horizontal axis |
|
|
||||||
| `right` | Align content on the right of the horizontal axis |
|
|
||||||
|
|
||||||
#### `VERTICAL`
|
#### <vertical>
|
||||||
|
|
||||||
| Value | Description |
|
--8<-- "docs/snippets/type_syntax/vertical.md"
|
||||||
| --------------- | ------------------------------------------------ |
|
|
||||||
| `top` (default) | Align content at the top of the vertical axis |
|
|
||||||
| `middle` | Align content in the middle of the vertical axis |
|
|
||||||
| `bottom` | Align content at the bottom of the vertical axis |
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user