Files
textual/docs/styles/text_style.md
2022-08-04 16:29:30 +01:00

1.1 KiB

Text-style

The text-style rule enables a number of different ways of displaying text. The value may be set to any of the following:

Style Effect
"bold" bold text
"italic" italic text
"reverse" reverse video text (foreground and background colors reversed)
"underline" underline text
"strike" strikethrough text

Text styles may be set in combination. For example "bold underline" or "reverse underline strike".

Example

=== "text_style.py"

```python
--8<-- "docs/examples/styles/text_style.py"
```

=== "Output"

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

CSS

text-style: italic;

Python

widget.styles.text_style = "italic"