As illustrated in the above image, I am trying to extend the sidebar navigation down the entirety of the parent container, but I'm stuck as to how to do this. I've been trying for quite some time and I'm still not exactly sure what it is that I need to do.
I have it structured in my HTML document as so:
<div class="container">
<div class="sidebar">
<ul>
<li>blah blah</li>
<li>blah blah</li>
<li>blah blah</li>
</ul>
</div>
LOREM IPSUM TEXT HERE
The CSS for the above is:
.container {
border-radius: 1px;
box-shadow: 0px 0px 0px 4px rgba(0,0,0,0.2);
background-color: #CDCDCD;
margin: auto;
margin-top: 6%;
width: 70%;
padding: 10px;
overflow: hidden;
}
.sidebar {
position: relative;
margin-left: 10px;
margin-right: 10px;
padding: 10px;
border-right: 1px solid;
border-right-color: rgba(0,0,0,0.1);
float: left;
width: 20%;
}
I appreciate any and all help that I can receive. I've poured over Google for an answer, and I can't tell if this is just down to me purely being stupid and having a mind fart. I've tried simple things like setting the min-height and height of the sidebar container to 100% to no avail. Thank you for your help.
Update
The flexbox approach seems to semi-work, but it interferes with my header code. The new result seems to be this:
This is my code:
.container {
border-radius: 1px;
box-shadow: 0px 0px 0px 4px rgba(0,0,0,0.2);
background-color: #CDCDCD;
margin: auto;
margin-top: 6%;
width: 70%;
padding: 10px;
overflow: hidden;
display: flex;
}
.container .header {
font-family: 'Raleway', sans-serif;
font-size: 20px;
}
.container .header .right {
float: right;
}
.sidebar {
position: relative;
margin-left: 10px;
margin-right: 10px;
padding: 10px;
border-right: 1px solid;
border-right-color: rgba(0,0,0,0.1);
float: left;
width: 20%;
flex-grow: 0;
flex-shrink: 0;
flex-basis: 20%;
}
And the HTML is:
<div class="container">
<div class="header">Bay Area Roleplay - AdminCP<div class="right">Dashboard</div>
<hr />
</div>
<div class="sidebar">
<ul>
<li>blah blah</li>
<li>blah blah</li>
<li>blah blah</li>
</ul>
</div>
LOREM IPSUM TEXT HERE