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
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?!?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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