Jump to content

Div won't auto expand with content inside it


EchoFool

Recommended Posts

Hey

 

I currently have a few divs with one in particular being a pain.

 

It will not expand if i put text within the div boundries...

 

 

 

This is my css and html:

 

#logodiv{
margin: 0 auto 0 auto; 
width: 950px; 
height:168px; 
background-image: url('test.png');
background-position:center bottom;
background-repeat:no-repeat;
}

#logotable{
margin: 0 auto 0 auto; 
width: 900px; 
}

#bodydiv{
margin: 0 auto 0 auto; 
width: 950px; 
height: auto;
background-image: url('bodybackground.png'); 
background-repeat: repeat-y; 
}

#innerbodydiv{
margin: 0 auto 0 auto; 
width: 900px; 
height: auto;
}

 

Then my structure:

<div id="logodiv"></div>

    <div id="bodydiv">

         <div id="innerbodydiv">

<p>content</p> (image about 500 lines)

         </div>

    </div>

Now the issue is - content does not expand the "bodydiv" div so the image will not repeat vertically.

 

The only way i could solve it was to put a fixed height like height:200px;.

 

Height: auto; and height:100%; did not work yet height:200px; does! Which is a problem because the height will vary depending on on the content of the pages.

 

Why is this?

 

Thanks

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.