#left{
border: dotted 1px;
height: 500px;
width: 200px;
float: left;
margin-top: 250px;
}
#right{
border: dotted 1px;
height: 500px;
width: 200px;
float: right;
margin-top: 250px;
}
#mid{
border: groove 1px blue;
height: 1000px;
max-width: 900px;
margin: auto;
}
<body>
<div id="left"></div>
<div id="mid"></div>
<div id="right"></div>
</body>
I want this middle div to be squished by the other two ones at the sides if page shrinks. But left one is not colliding with the middle ones borders. And also right one is at the bottom.
How can I do this?

This is how ı want it to look like.