I've got a JS Fiddle working of exactly what I would like: http://jsfiddle.net/j7ay4qd8/5/
It comprises of two columns which are separately scrollable and different sections of the left column can be easily scrolled to via javascript without affecting the right column or the rest of the page.
However the only way i've got this working for this example is to hardcode the height using the px's of the two nav's.
height:calc(100vh - 90px);
Of course this may not work on different browsers, devices and resolutions.
And it will break if any elements are added or the size of those navs changes.
What I really want is for the #form to automatically resize to fill whatever is left of the viewport.
With my current example, if I added another element such as an alert the #content and #sidebar would be longer than the viewport and i'd get jumpy scroll as the whole page scrolls after the #content div has scrolled.
Example with alert and jumpy scroll: http://jsfiddle.net/c4k9u0mr/
I've found this jsfiddle which seems to explain what I want using flexbox: http://jsfiddle.net/7yLFL/
However my attempts at doing this with flexbox haven't worked either. The only way that I can get the #content and #guidelines to be separately scrollable is if I give them a fixed height and i'm back to square one of how to make those divs 100% of the container div.
Here's my failed attempt using flexbox (it has a fixed height of 100px in this example): http://jsfiddle.net/jh6d5ztq/
Is it possible to get the first and second JS Fiddle's working without defining a fixed height using px?