I'm trying to make three independent scroll layout in CSS. The independent columns are not scrolling. If I modify the style then the whole page is scrolling. I need to scroll keep the left and right column static while the middle column only scroll. HTML
<div>
<div id="nav">
<ul>
<li>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search Quora" name="search" onfocus="quo(this)">
</form>
</div>
</li>
<li>
<a href="#user"><i class="fas fa-user-circle fa-lg"></i></a>
</li>
<li>
<button class="add">Add Question</button>
</li>
</ul>
</div>
<div class="content">
<div id="left">
<h2>Column 1</h2>
<p>Some text..</p>
</div>
<div id="middle">
<h2>Column 2</h2>
<p>By way of precaution, when all was complete De Rozier made a few short captive excursions, the balloon being fastened to earth by a rope. But all proving satisfactory, he decided to hazard a right away trip on the 21st of November 1783, when he was also to be accompanied by an equally courageous fellow-countryman, the Marquis dArlandes. It would be difficult to conceive a more daring and perilous enterprise than these two brave Frenchmen set themselves. They were to venture, by an untried way, into unknown realms where no mortal had been before; they were to entrust their lives to a frail craft whose capabilities had never yet been tested, and at a giddy height they were to soar aloft with an open fire, which at any moment might set light to the inflammable balloon and hurl them to destruction.</p>
</div>
<div id="right">
<h2>Column 3</h2>
<p>Some text..</p>
</div>
</div>
</div>
CSS
#left{
float: left;
width: 25%;
background: blue;
height: 100%;
overflow: auto;
box-sizing: content-box;
padding: 0.4em;
}
#right {
float: left;
width: 25%;
background: red;
height: 100%;
overflow: auto;
box-sizing: content-box;
padding: 0.4em;
}
#middle {
float: left;
width: 50%;
background: coral;
height: 100%;
overflow: auto;
box-sizing: content-box;
padding: 0.4em;
}
.content{
padding-top:60px;
padding-left:20px;
padding-right:20px;
height: 100%;
}
html, body {
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
}
Whats the problem? I used this solution it worked perfectly fine there. https://jsfiddle.net/hr6au65b/ I think there's some issue with content style in CSS.