Files
textual/docs/styles/max_height.md
darrenburns 9e883d3e45 Document styles (#785)
* Add docs for CSS variables

* Add ref docs for various styles, fix some typos in places
2022-09-15 16:32:23 +01:00

445 B

Max-height

The max-height rule sets a maximum height for a widget.

Syntax

max-height: <SCALAR>;

CSS


/* Set a maximum height of 10 rows */
max-height: 10;

/* Set a maximum height of 25% of the screen height */
max-height: 25vh;

Python

# Set the maximum height to 10 rows
widget.styles.max_height = 10

# Set the maximum height to 25% of the screen height
widget.styles.max_height = "25vh"