Adam DePolo
Adam DePolo

Reputation: 51

Why won't the "div" expand with the content inside it?

I added a DIV called "midsection" inside the body. It contains all of the content like the slideshow and the information below it. I set the midsection height to "98%" but it will not expand with the content inside of it. The actual page does expand but the DIV does not.

-HTML http://e.pictureupload.us/118270967451ca3420af8dd.jpg

-CSS

#midsection{
position:relative;
top:31px;
width:75%;
height:98%;
margin-left:12.4%;
background:#f3f4f4;
border-left: 1px black solid;
border-right: 1px black solid;
word-wrap: break-word;
}

Upvotes: 0

Views: 145

Answers (3)

Cynthia
Cynthia

Reputation: 5403

Try adding overflow:hidden to the CSS for the div.

Upvotes: 0

Danield
Danield

Reputation: 125443

Try adding overflow:auto to the div:

#midsection
{
  ...
  overflow:auto
}

Upvotes: 0

Adam
Adam

Reputation: 802

A div has an inherent maximum height of it's container. You would have to make sure every item in the DOM containing this div has a height of at least 98%. For instance, if the div was just in the body, you can add:

html{ min-height:98%; }
body{ min-height:98%; }

Upvotes: 1

Related Questions