Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 661261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:14:52+00:00 2026-05-13T23:14:52+00:00

I am trying to make my DIV’s height expand to it’s child elements. I

  • 0

I am trying to make my DIV’s height expand to it’s child elements. I have read some other posts, but have been unable to make the answer for those issues work for me.

Here is a sample HTML the represents my problem.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title></title>
    <style type="text/css">
        .PropertyPanelMain
        {
            font-size: 8pt;
            color: #000;
            border: 2px solid #ccc;
            width: 100px;
            height: 100px;
        }
    </style>
</head>
<body>
    <div class="PropertyPanelMain">
        <div style="">This content should make the outer DIV expand. This content should make the outer DIV expand. This content should make the outer DIV expand. This content should make the outer DIV expand. </div>
        <div style="">More content</div>
            <div style="clear:both;"></div>
    </div>
</body>
</html>

Can someone show me how to make the outer DIV expand to its contents (the two child DIV’s)?

Thanks,
John

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:14:53+00:00Added an answer on May 13, 2026 at 11:14 pm

    If you want it to expand then do not force a height on it…

    remove the height:100px; from the css rule.

    It seems like you want to float the inside divs. If that is the case you can (after removing the height) either do it with the clearing div, or remove the clearing div and set the overflow to auto on the PropertyPanelMain rule..

    .PropertyPanelMain
            {
                font-size: 8pt;
                color: #000;
                border: 2px solid #ccc;
                width: 100px;
                overflow:auto;
            }
    

    [update to comment]

    To use a minimum height you can use the min-height css property, but since it is not supported by all browsers we do a trick using the !important css directive

    .PropertyPanelMain
            {
                font-size: 8pt;
                color: #000;
                border: 2px solid #ccc;
                width: 100px;
                overflow:auto;
    
                min-height:100px; 
                height:auto!important;
                height:100px;
            }
    

    IE will ignore the height:auto rule because it does not respect the !important directive, but by de-fault it will expand to include content..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make a div fade in evey 30sec and out
I'm trying to make a div 's height stretch out to 100% but everything
I have been trying to make a DIV box appear in front of the
I'll keep it brief. I'm trying to make a div element height 100%. All
I'm trying to make a div with a static height and variable width. With
im trying to make a div fade out and then have a second div
im trying to make this div have the same styling properties as my textarea
I'm trying to make a div the same height as the parent (if the
I'm trying to make some div to animate, then in the callback, call another
I'm trying to make my DIV background loop between 3 images. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.