File: border_title_align.md

package info (click to toggle)
textual 2.1.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,080 kB
  • sloc: python: 85,423; lisp: 1,669; makefile: 101
file content (66 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Border-title-align

The `border-title-align` style sets the horizontal alignment for the border title.

## Syntax

--8<-- "docs/snippets/syntax_block_start.md"
border-title-align: <a href="../../css_types/horizontal">&lt;horizontal&gt;</a>;
--8<-- "docs/snippets/syntax_block_end.md"

The `border-title-align` style takes a [`<horizontal>`](../css_types/horizontal.md) that determines where the border title is aligned along the top edge of the border.
This means that the border corners are always visible.

### Default

The default alignment is `left`.


## Examples

### Basic usage

This example shows three labels, each with a different border title alignment:

=== "Output"

    ```{.textual path="docs/examples/styles/border_title_align.py"}
    ```

=== "border_title_align.py"

    ```py
    --8<-- "docs/examples/styles/border_title_align.py"
    ```

=== "border_title_align.tcss"

    ```css
    --8<-- "docs/examples/styles/border_title_align.tcss"
    ```


### Complete usage reference

--8<-- "docs/snippets/border_sub_title_align_all_example.md"


## CSS

```css
border-title-align: left;
border-title-align: center;
border-title-align: right;
```

## Python

```py
widget.styles.border_title_align = "left"
widget.styles.border_title_align = "center"
widget.styles.border_title_align = "right"
```

## See also

--8<-- "docs/snippets/see_also_border.md"