I’m programming a website and on a page I have dynamic content. To be specific I want to display some content in a div each. And the main div wont stretch upon this content.
#main{
position:relative;
background-image:url(images/main_middle.png);
background-repeat:repeat-y;
width:850px;
min-height:450px;
}
.intrebari{
position:relative;
width:400px;
min-height:150px;
padding:20px;
}
while($row=mysql_fetch_array($rezultat)){
echo '<div class="intrebari">
<div id="upleft"></div>
<div id="upright"></div>
<div id="downleft"></div>
<div id="downright"></div>
'.$_SESSION['username'].' a intrebat:<br />
'.$row['question'].'
</div>';
}
What am I doing wrong?
The internal div has to be cleared so the outer should know the height of the inner div
you may use a class
and introduce it after your inner div inside outer div main
this will help you
If you have given float to intrebari, you need to give float left or right to main div to get the main wrap the inner content