I have a <div>
which needs to be auto adjusted according to the content in it. How can I do this? Right now my content is coming out of the <div>
The class I have used for the div is as follows
box-centerside {
background:url("../images/greybox-center-bg1.jpg") repeat-x scroll center top transparent;
float:left;
height:100px;
width:260px;
}
Just use this display type:
<div>
should expand automatically. I guess that the problem is that you're using fixedheight:100px;
, try replacing it withmin-height:100px;
Just write "min-height: XXX;" And "overflow: hidden;" & you will be out of this problem Like this
Set a height to the last placeholder div.
For me after trying everything the below css worked:
Try in chrome by inspecting element before putting it in css file.
Simple answer is to use
overflow: hidden
andmin-height: x(any) px
which will auto-adjust the size of div.The
height: auto
won't work.