user2685777
user2685777

Reputation: 11

Get Content <div> to stretch 100% even with scrollbar

I am currently working on a process site for my Web Design I class. Seeing that I have previous knownledge of HTML I didn't want to stick to a generic layout of my site.

That being said I have come across this problem in the past and just can't remember how to fix it.

http://bccvisualdesign.com/art271/simmons/index.html

As you can see if you resize the browser the div doesn't stretch once a scrollbar is introduced. I am wondering if it is my CSS for the div?

div.content{
width: 50%;
margin-left: 25%;
background: #FFF;
position: fixed;
top: 0;
bottom: 0;
padding: 0px 35px 0px;
-moz-box-shadow: 0 0 40px #000;
-webkit-box-shadow: 0 0 40px #000;
box-shadow: 0 0 40px #000;
}

The goal is to have the white div infinitely stretch top to bottom regardless of the scroll or not. Thank you all for your help!

Upvotes: 1

Views: 297

Answers (1)

John
John

Reputation: 3415

Using position: absolute rather than position: fixed, as in your live example, you can get this to work by removing the bottom position, or changing it to bottom: auto, and setting a min-height: 100% on div.content.

Upvotes: 1

Related Questions