One really sucky thing about CSS is it’s lack to make stuff 100% height. You’ll face this especially with sidebars, if there is not enough content to fill the sidebar, it falls short and looks ugly. Luckily there are workarounds.
Requirements for our 100% height sidebar techniques:
This works like a table layout, but without the table. We can set 100% height to all the elements. Check the commented code under the HTML and CSS tabs.
You can strip out either one of the sidebars and it still works.
This is a bit more "hacky" in a way, but works great. You just fixed position the sidebar pseudo elements. Downside to this technique is that you can't animate the sidebars (if you need to get the sidebars out of the way by toggling their visibility). See the commented code under the css and html tabs.
One day the
flexbox method will gain browser support and we can use it. Meanwhile, we have to use these.
Comments would go here, but the commenting system isn’t ready yet, sorry. Tweet me @hiljaa if you want to make a correction etc.