Issue
I have this basic layout with a static header and footer, pushed to the top and bottom respectively. The content section in the middle fills the space, and there's a scrollbar for this section in case the content is too large for it to fit.
<div id="app">
<div id="header">
Header
</div>
<div id="middle">
Middle content
</div>
<div id="footer">
Footer
</div>
</div>
html,
body {
height: 100%;
overflow: hidden;
margin: 0;
}
#app {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
#header {
height: 60px;
background-color: blue;
}
#footer {
height: 60px;
background-color: red;
}
#middle {
flex: 1;
overflow-y: scroll;
align-items: flex-end;
}
I want the content of this middle section to start from the bottom, and not the top, while keeping the overflow scrollbars in case the content is too big, but I can't seem to figure out how.
I've tried setting margins to 0 and read about flex-direction, but none of those seem to work.
Solution
You can try the following :
<div id="header">
Header
</div>
<div id="middle" class="content-end">
Middle content
</div>
<div id="footer">
Footer
</div>
</div>
Please add this in your css:
.content-end
{
display: flex;
justify-content: start;
}
Answered By - Rafia Zafar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.