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;
}
I have fixed my issue by setting the position of the element inside a div to relative;
simply set the height to auto, that should fix the problem, because div are block elements so they stretch out to full width and height of any element contained in it. if height set to auto not working then simple don't add the height, it should adjust and make sure that the div is not inheriting any height from it's parent element as well...
Try with the following mark-up instead of directly specifying height:
I've used the following in the DIV that needs to be resized:
just use following
height:59.55%;//First specify your height then make overflow auto overflow:auto;