Solved

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

Posted on 2013-06-25
2
492 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
ID: 39276642
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
ID: 39276650
Perfect, thanks! I think I got it.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

825 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