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
https://forums.phpfreaks.com/topic/279030-problem-with-auto-height-for-divs/
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:

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.