Jump to content

Problem with auto height for DIVs


FarrisFahad

Recommended Posts

Hi, I have a problem with the divs, when I set them to auto height they don't stretch with the content inside them, (another divs) 

Check out the code below ...

#LatestFunnyPicturesLOut{
	width:1080px;
	height:auto;
	background-color:rgba(255,0,0,0.30);
	margin:auto;
	padding:10px;
}

#LatestFunnyPicturesLIn{
	width:1060px;
	height:auto;
	background-color:#FFF;
	padding:10px;
}

#PicturesBox{
	width:800px;
	height:1500px;
	float:left;
}

HTML ...

<div id="LatestFunnyPicturesLOut">
	<div id="LatestFunnyPicturesLIn">
    	<div id="PicturesBox"></div>
    </div>
</div>
Link to comment
Share on other sites

After researching I have found that I just needed to add the overflow property to the container and set it's value to auto ...

I did it like this ...

#LatestFunnyPicturesLOut{
	width:1080px;
	height:auto;
	background-color:rgba(255,0,0,0.30);
	margin:auto;
	padding:10px;
	overflow:auto;
}

#LatestFunnyPicturesLIn{
	width:1060px;
	height:auto;
	background-color:#FFF;
	padding:10px;
	overflow:auto;
}

#PicturesBox{
	width:800px;
	height:1500px;
	float:left;
}

Hope that this helps anyone in trouble :) peace out :geek:

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.