The padding rule adds space around the content of a widget. You can specify padding with 1, 2 or 4 numbers.
||A single value sets a padding of 1 around all 4 edges|
||Two values sets the padding for the top/bottom and left/right edges|
||Four values sets top, right, bottom, and left padding independently|
Padding may also be set individually by setting
padding-left to a single value.
This example adds padding around static text.
from textual.app import App from textual.widgets import Static TEXT = """I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past, I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.""" class PaddingApp(App): def compose(self): yield Static(TEXT) app = PaddingApp(css_path="padding.css")