For my website, I can't get my side column to extend all the way to the end of the body column without giving it a fixed max height (it's supposed to adjust according to the length of the body, which is altered either by the amount of words/content the body has and/or the wrapping of the body in a smaller screen). Please keep in mind that I have a footer at the bottom that is supposed to take up the entire width of the screen so I can't do something that makes the side column longer than anything and keep everything else on the body column.
Here is my example: https://jsfiddle.net/r7g20fvk/
Here is the code:
<style>
.sidebar_container {
float: right;
width: 70%;
max-width: 230px;
margin: 0px 20px 20px 0;
min-width: 300px;
/*I can add a min-height until the side column is long enough to reach the entire bottom rather than end after the content runs out, but it doesn't adjust accordingly (to the length of the body column, whether the screen makes the body longer or the amount of text makes the body longer)*/
}
.left {
overflow: hidden width: 70%;
line-height: 2;
font-size: 18px;
}
</style>
<div class="left">
<h2>Home</h2>
</div>
<div>
<div class="sidebar_container" style="float: right;">
<div class="sidebar">
<h2>Post 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fringilla vulputate mauris fermentum laoreet. Suspendisse lacinia tincidunt lectus...
<a href="#">Read More</a>
</p>
</div>
<div class="sidebar">
<h2>Post 2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fringilla vulputate mauris fermentum laoreet. Suspendisse lacinia tincidunt lectus.. <a href="#">Read More</a></p>
</div>
<div class="sidebar">
<h2>Post 3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fringilla vulputate mauris fermentum laoreet. Suspendisse lacinia tincidunt lectus, in iaculis neque aliquam vitae. Ut mattis aliquet mi, eu cursus est placerat id. Donec vehicula lorem
neque, vel mattis arcu semper in...<a href="#">Read More</a></p>
</div>
<!--close sidebar-->
</div>
<div class="left">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fringilla vulputate mauris fermentum laoreet. Suspendisse lacinia tincidunt lectus, in iaculis neque aliquam vitae. Ut mattis aliquet mi, eu cursus est placerat id. Donec vehicula lorem
neque, vel mattis arcu semper in. Aenean venenatis pulvinar sagittis. In eget congue sapien, in semper ligula. Curabitur sagittis mi a lacinia fermentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eu enim a mauris ullamcorper
tincidunt ac vel erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus lacinia, velit eu eleifend interdum, lacus velit maximus nisi, ut feugiat metus metus in mauris. Nunc molestie libero
quis odio tristique euismod.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fringilla vulputate mauris fermentum laoreet. Suspendisse lacinia tincidunt lectus, in iaculis neque aliquam vitae. Ut mattis aliquet mi, eu cursus est placerat
id. Donec vehicula lorem neque, vel mattis arcu semper in. Aenean venenatis pulvinar sagittis. In eget congue sapien, in semper ligula. Curabitur sagittis mi a lacinia fermentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi eu
enim a mauris ullamcorper tincidunt ac vel erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus lacinia, velit eu eleifend interdum, lacus velit maximus nisi, ut feugiat metus metus in mauris.
Nunc molestie libero quis odio tristique euismod.</p>
</div>
</div>
Is there a way to make it adjust accordingly? Perhaps make the side column's width be a percentage of the entire width of the screen so it isn't a fixed width when viewing at a smaller screen size, or make it completely disappear or something when in super-small mobile screens. I'm trying to make it mobile friendly and adjust its height based off of the bottom.
Do you think making a table (with two columns, one as body and one on the side) would be a better way of making the webpage mobile friendly and automatically adjust to the wrapping of content? Or is there a better way using div grouping?