Solved

Using CSS to add scrollbars to <div> placed inside fixed-position <div>

Posted on 2013-06-25
2
482 Views
Last Modified: 2013-06-25
Test page:
http://partnersdesign.net/test

Click the "Partners Design, Inc." navigation button at the top. There are two <div>'s nested like this:

<div id="partnersdesignwrapper">
      <div id="partnersdesign" class="clearfix">
            ...content...
      </div>
</div>

Styled like this:

div#partnersdesignwrapper{display:none;
	position:fixed;
	top:0;
	left:0;
	width:100%;
	height:100%;
	margin-top:4em;
	background-color:rgba(0,0,0,0.7);
	}
div#partnersdesign{position:relative;
	width:66em;
	margin:3em auto;
	padding:0 0 2em 0;
	background-color:rgba(255,255,255,0.9);
	color:#000;
	font-family:Arial,Helvetica,sans-serif;
	font-size:0.9em;
	min-height:800px;
	height:auto !important;
	height:800px;
	}

Open in new window


Everything works exactly the way I want, except if you click the "Partners" sub-nav link, for example (and your browser window is not tall enough), no scrollbars appear at the right.

Is it possible to allow that <div> to have its content scroll, even though it is inside a position:fixed <div>? If you look at the page, you can see what the issue is... you can't read the content that is further down the page.

Thank you!
0
Comment
Question by:bbdesign
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
That's because your whole page is very tall
You could add a fixed height to the div and use overflow:auto
That would give scrollbars, but it needs the fixed height
0
 

Author Comment

by:bbdesign
Comment Utility
Perfect, thanks! I think I got it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now