I have the following markup:
<div id="app-container" class="row h-100 main-content">
<div class="col-md-4 order-mb-1 sidebar">
<ul class="mb-3 sidebar-list">
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
</div>
<main role="main" class="col-md order-md-2 h-100 pl-4 pr-4 pt-3 pb-2">
<div class="row align-items-center">
<div class="col">
<h1>Page Title </h1>
</div>
</div>
<hr>
<div id="text">Sometimes large amounts of text</div>
</main>
</div>
This is the CSS that I have:
html, body {
height: 100%;
}
.sidebar {
border-right: 1px solid #ccc;
padding-right: 0;
padding-left: 0;
max-width: 375px;
}
My issue is that if #text
has content that spans more than the current viewport the height of the .main-content
doesn't go to 100% height, but instead sticks to whatever the viewport height is. Also note that I would like it to be 100% even if the content is short (so it should be always a 100%).
I hope that makes sense.
Here is an example that I've setup to illustrate the problem (scroll down past the viewport to see it).
https://codepen.io/anon/pen/ZMZYQY?editors=1100#0
Any help would be much appreciated.