Jump to content

Stretching a div to the containing div (NOT a float issue)


Zeradin

Recommended Posts

Hello. I am trying to this thing that'll be really cool that is have a div in the center of a page that has a width but when it needs to scroll i don't want the scroll bar to be at the edge of the div, i want it to be on the edge of the page.

 

So I set the middle div to have overflow: hidden and the containing div to have overflow: auto but then I just can't scroll. There's gotta be a way to do this, no? Here's what I got for them:

 

.twoColFixLtHdr #mainContent { 
margin: 0 0px 0 0px; 
padding: 0 30px 0 30px; 
border: 1px solid white;
width: 80%;
height: 450px;
overflow: hidden;
text-align: justify;
z-index:10 !important;
background: url(trans.png);
position: relative;
}

.twoColFixLtHdr #content-container {
margin: 0;
padding: 0;
border: none;
width: auto;
overflow: auto;
height: 450px;
background: url(hands2.png) no-repeat;
background-position:30% 90%;
}

 

if you could help that'd be great! thanks.

 

Link to comment
Share on other sites

What?

 

Haha ok basically I have everything on the site not moving except a small content area in the middle. So now it's a square with a scroll bar. I wanted the scroll bar off of the square and on the side of the screen like it is on most sites. My solution was to make it have a hidden overflow on the content square and have an auto overflow on a div that has 100% width and is containing the square. My hope was to get the containing div to see that it had more content because the div it's containing is long, but I think because it is hidden it doesn't see the overflow. Is there a way around this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.