JSbin here for visuals and code.
Left sidebar, full height, fixed position, content overflows that needs to be accessible WITHOUT scrollbars (that means no overflow: scroll
). I really don't want to do this in Javascript.
At one point months ago, I accomplished this in CSS with overflow: hidden
and something else and now I can't find the code or remember how it was done. And Google is useless for this for some reason. This sidebar has content to the right of it on my site that continues down the page. The bar itself has more than fits vertically on the screen.
I need to be able to scroll down this object, whether it's fixed or absolute, and it must span the height of the page all the way down. Scrolling main content and the sidebar are independent. So far, even with setting to absolute, the wrapper will stop way short of the page bottom.
I've tried every combination of position
, float
, overflow
, height
/max-height
, top
, bottom
, left
and display
that I can think of. Tried lots of other stuff too with no luck.
Any help is greatly appreciated.
CSS:
#left-wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
z-index: 3;
max-width: 24em;
height: 100%;
overflow: hidden;
background-color: rgba(26,26,26,1);
}
#left-bar {
max-width: 100%;
max-height: none;
position: relative;
}
#left-bar.sidebars .block {
padding: 5%;
border-right: none;
margin: 5%;
background-color: rgba(255,255,238,0.4);
margin-bottom: 1.5em;
font-size: 0.9em;
overflow: hidden;
}
.sidebars .block ul {
margin: 0;
padding: 0;
list-style: none;
}
.sidebars h2 {
padding: 0;
margin: 5% 10% 0;
font-size: 1.75em;
text-transform: lowercase;
font-weight: 400;
text-align: right;
/*border-bottom: 1px dashed #9c561b;
color: #9c561b;
text-shadow:#130b08 0 1px 0;*/
}
#left-wrap a {
color: #FDC;
}
HTML:
<div id="left-wrap">
<div id="left-bar" class="sidebars">
<div class="block">
<h2>Title One</h2>
<ul class="menu">
<li>Link One</li>
<li>Link Two</li>
<li>Link Twenty-five</li>
<li>Link Seventy</li>
<li>Link One Hundred Fifty-two</li>
<li>Link Zero</li>
</ul>
</div>
<div class="block">
<h2>Title Two</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
</div>
<div class="block">
<h2>Title Three</h2>
<ul class="menu">
<li>Link One</li>
<li>Link Two</li>
<li>Link Twenty-five</li>
<li>Link Seventy</li>
<li>Link One Hundred Fifty-two</li>
<li>Link Zero</li>
</ul>
</div>
<div class="block">
<h2>Title Four</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
</div>
<div class="block">
<h2>Title Five</h2>
<ul class="menu">
<li>Link One</li>
<li>Link Two</li>
<li>Link Twenty-five</li>
<li>Link Seventy</li>
<li>Link One Hundred Fifty-two</li>
<li>Link Zero</li>
</ul>
</div>
<div class="block">
<h2>Title Six</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
</div>
<div class="block">
<h2>Title Seven</h2>
<ul class="menu">
<li>Link One</li>
<li>Link Two</li>
<li>Link Twenty-five</li>
<li>Link Seventy</li>
<li>Link One Hundred Fifty-two</li>
<li>Link Zero</li>
</ul>
</div>
<div class="block">
<h2>Title Eight</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
</div>
</div>
</div>
See Question&Answers more detail:
os