Trying to vertically align a label inside a Horizontal container #4809
-
Why does the label not align correctly? It's always stuck in the left upper corner. class TextInput(Static):
DEFAULT_CSS = """
#label {
align: left middle;
height: 1;
}
"""
def compose(self) -> ComposeResult:
with Horizontal():
yield Label("Label", id="label")
yield Input() |
Beta Was this translation helpful? Give feedback.
Answered by
TomJGooding
Jul 27, 2024
Replies: 1 comment 1 reply
-
https://textual.textualize.io/FAQ/#how-do-i-center-a-widget-in-a-screen |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Banbury
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
align
works on the children of a container, it isn't something you use on the child you want centered.https://textual.textualize.io/FAQ/#how-do-i-center-a-widget-in-a-screen
https://textual.textualize.io/how-to/center-things