I want to create an page layout that is split into 3 parts - one column with fixed width that contain two rows with fixed height. and another column with fixed width, that can potentially contain multiple items (more than fit into view).
I'm looking for a way to make the page scrolling only affect the items column, so that the left side of the screen (first column) remains on view.
Here is a sample image of the layout to better illustrate the meaning:
For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.
To hide the horizontal scrollbar and prevent horizontal scrolling, use overflow-x: hidden: HTML.
Suppose we want to add a scroll bar option in HTML, use an “overflow” option and set it as auto-enabled for adding both horizontal and vertical scroll bars. If we want to add a vertical bar option in Html, add the line “overflow-y” in the files.
Apply overflow:auto
for your right side columns. Look at the following sample HTML.
<div style="width:450px;">
<div style="float:left; width:300px">
<div style="height:120px; border:1px solid #ff00ff;">Testing Content</div>
<div style="height:200px; border:1px solid #fff000;">Sample INformation</div>
</div>
<div style="float:right; width:100px; height:320px; overflow:auto;">
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
<p>items</p>
</div>
</div>
SAMPLE DEMO
You can use frame or fix the position of left column.
.left
{
position:fixed;
}
Why not float your items container right, then have a left column which is position:fixed?
.left { position:fixed;width:70% }
.right { float:right;width:30%; }
<div>
<div class="left">
This content is fixed and does not scroll
</div>
<div class="right">
<ul>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
<li>item></li>
</ul>
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With