So, what I ultimately want to achieve is this:
https://s17.postimg.org/7zkpt511r/imgdivs.png
what I have so far:
<style type="text/css">
.wrapper{
height: 100%;
width: 100%;
}
.left{
float: left;
background: silver;
height: 100%;
}
.right{
background: silver;
float: right;
height: 100%;
}
canvas{
position: absolute;
height: 100%;
}
</style>
<div class = "wrapper">
<div class = "left"></div>
<canvas id="canvas"></canvas>
<div class = "right">
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
var WIDTH = 200; //could be anything, comes from previous calculations
$('#canvas').css("width", WIDTH);
$('#canvas').css("left", (window.innerWidth - WIDTH) / 2);
$('.left').css("width", (window.innerWidth - WIDTH) / 2);
$('.right').css("width", (window.innerWidth - WIDTH) / 2);
var canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(0, 0, WIDTH, window.innerHeight);
</script>
So a little explanation, the canvas in the middle is dynamic in it's width(calculated with javascript) and pre-decided with it's height(100%), it is placed in the middle of the page, and the two divs to it's sides should stretch accordingly and equally and fill the rest of the page. I have many problems in my code; the divs sometimes overflow one below another, the canvas for some reason doesn't fillStyle it's whole dimension and so on.
I am afraid to try to do it in flexbox since old browsers do not support it properly, and I need all browsers support. Thank you for your time.