File size: 791 Bytes
5b76e0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Height

The `height` rule sets a widget's height. By default, it sets the height of the content area, but if `box-sizing` is set to `border-box` it sets the height of the border area.

## Syntax

```
height: <SCALAR>;
```

## Example

This examples creates a widget with a height of 50% of the screen.

=== "height.py"

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

=== "height.css"

    ```python
    --8<-- "docs/examples/styles/height.css"
    ```

=== "Output"

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

## CSS

```sass
/* Explicit cell height */
height: 10;

/* Percentage height */
height: 50%;

/* Automatic height */
width: auto
```

## Python

```python
self.styles.height = 10
self.styles.height = "50%
self.styles.height = "auto"
```