I have a website that looks something like this: https://codepen.io/Username123T/pen/GRvwmoq
HTML code
<body>
<div class="App">
<div class="Nav"></div>
<div class="MainPage">
<div class="Sidebar">
<div class="LinksToOtherMessagesFromUser">
</div>
</div>
<div class="Message"></div>
</div>
</div>
</body>
CSS code
.App {
background-color: black;
display: flex;
flex-direction: column;
flex: 1;
}
.Nav {
flex: 1;
}
.MainPage {
display: flex;
flex: 1;
background-color: turquoise;
}
.Sidebar {
flex: 1;
background-color: thistle;
display: flex;
}
.LinksToOtherMessagesFromUser {
margin: 3vh;
flex: 1;
background-color: blue;
overflow: auto;
}
.Message {
background-color: violet;
flex: 1;
}
body {
height: 100vh;
display: flex;
flex-direction: row;
}
And when i add Content that is bigger than the box, it should add a Scroll bar. But instead it just expands like this: https://codepen.io/Username123T/pen/PoKxmGW
<body>
<div class="App">
<div class="Nav"></div>
<div class="MainPage">
<div class="Sidebar">
<div class="LinksToOtherMessagesFromUser">
<p>Message 1</p>
<p>Message 2</p>
<p>Message 3</p>
<p>Message 4</p>
<p>Message 5</p>
<p>Message 6</p>
<p>Message 7</p>
<p>Message 8</p>
</div>
</div>
<div class="Message"></div>
</div>
</div>
</body>
I would prefer not to set a max-height, or only if it is relativ to its parent (Sidebar).
Any help is welcome, thanks in advance.
I took a look at the link that was the reason why my question got closed: One flex/grid item sets the size limit for siblings
But i am not quite sure how this is supposed to help me. I added
flex-basis: 0px;
flex-grow: 1;
https://codepen.io/Username123T/pen/oNeQevd
to the sibling (Input) but it doesn't do anything... Did i miss anything?