-
Hello, I'm trying to set a container layout in order that the upside and bottomside of the container have a fixed size (not percent) and the centreside (the red part of the snapshot) take the remaining place. The only thing I've seen it's using % like : grid-rows : 15% 70% 15% but in this case the up and bottom parts are realtive not fixed. I don't know if it is a lack of css knowledge or something else from me but if someone has and answer that help me to understand Thanks Mickael Here under the login.py snippet :
And the dialogLogin.css :
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If I've understood the basics of what you're trying to lay out, I think this is roughly what you're looking for? from textual.app import App, ComposeResult
from textual.widgets import Footer
from textual.containers import Container
class LayoutTest( App[ None ] ):
CSS="""
#left {
width: 20%;
height: 100%;
dock: left;
border: solid grey;
background: #555;
}
#top {
height: 20;
dock: top;
border: solid grey;
background: #555;
}
#body {
border: dashed red;
background: yellow;
}
#bottom {
height: 20;
dock: bottom;
border: solid grey;
background: #555;
}
"""
def compose(self) -> ComposeResult:
yield Container(
Container(id="left"),
Container(
Container(id="top"),
Container(id="body"),
Container(id="bottom")
)
)
yield Footer()
LayoutTest().run() |
Beta Was this translation helpful? Give feedback.
If I've understood the basics of what you're trying to lay out, I think this is roughly what you're looking for?