Jump to content

Can't get div to expand in size


defroster

Recommended Posts

Hello,

 

In my stylesheet I have the following:

.main
{
padding: 0px;
margin-top: 20px;
height: 420px; 
border:1px dashed #000000;
margin-bottom: 20px;
width:620px;
webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: 20px;
background-color: #f2f2f2;
}

 

If I remove the height tag my div doesn't expand as the content fills it.. how can I make the height auto-resisze as content fills the div?

 

Thanks /df

Link to comment
https://forums.phpfreaks.com/topic/250568-cant-get-div-to-expand-in-size/
Share on other sites

Hmm. Yes, I did remove the height... But I'll post the code here.  Thanks for help!!

 

The HTML

<div class='main'>

<div class='voting area'>

   <div class='title' align='center'>Vote</div>

    <div class='report'><a href="report_exe.php?v=7794" onclick="return popitup('report_exe.php?v=7794')">report</a></div>

</div>

<div class='video area'>
  <div class='title'>The ballerina dog</div>
  <div class='titletext'>Dog with a skirt</div>
  <img src='photo22'><br />

   <div class='titletext'>Posted 2 months ago </div>		

</div>
</div>


 

The stylesheet

.main
{
padding: 0px;
margin-top: 20px;
overflow:auto;
border:1px dashed #000000;
margin-bottom: 20px;
width:620px;
webkit-border-radius: 20px;-moz-border-radius: 20px;border-radius: 20px;
background-color: #f2f2f2;
}

.votingarea
{
float:right; height:130px; width:55px; margin-top:5px; margin-left:0px; margin-right:15px;  border:0px dashed #000000;
}

.report{
float:right; height:50px; width:55px; margin-top:135px; margin-right:0px;  border:0px dashed #000000;
background-color: #f2f2f2;
text-align: center;

}
.videoarea
{
padding-top: 0px;
padding-bottom: 0px;
float:left; width:530px; text-align:left; margin-left:15px; margin-top:10px;height:380px;  border:0px solid #000000;
font-weight:bold;

font-size:18px;

}

.title {
font-weight: bold;
font-size: 18px;
border:0px dotted #000000;
}

.titletextprofile {
font-size: 14px;
border:0px dotted #000000;
}

 

Thanks a million. Instead of a scrollbar in the 'main' div I would like it to expand?!?

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.