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

  • SEARCH
  • Home
  • 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 7278415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:52:17+00:00 2026-05-28T22:52:17+00:00

I have an issue with dynamically resizing the height of my sidebar div to

  • 0

I have an issue with dynamically resizing the height of my sidebar div to match the content div.
Based on various other questions here and google searches, I thought that without a height set, it would use the parent div height, but it seems to auto-fit the height to the content instead.

This can be seen on “baradineholdings.com.au” (please don’t judge the site, I’m a noob for one and I would rather get the basics working properly before I make it ‘pretty’).

The home page looks fine, mainly because of no content. If you head to the about page you can see the issue. I almost suspect that in the instance of the main page, the content div is taking the height of the sidebar div, but I’m not sure why.

HTML;

<body>
    <div id="wrapper">
        <?php include('includes/header.php'); ?>
        <div id="internal">
            <div id="sidebar">
                <h3>Navigation</h3>
                    <li><a href="index.php">Home</a></li>
                    <li><a href="about.php">About</a></li>
                    <li><a href="gallery.php">Gallery</a></li>
                    <li><a href="contact.php">Contact</a></li>
            </div> <!-- end #sidebar -->
            <div id="content">
                <p>Images Coming Soon!</p>
                <p>Please see the about page for more information.</p>
            </div> <!-- end #content -->
        </div> <!-- end #internal -->
        <?php include('includes/footer.php'); ?>
    </div> <!-- end #wrapper -->
</body>

CSS;

body {
background-color: #f1f1f1;
font-family: georgia,sans-serif;
color: #333;
margin: 0;
padding: 0;
}

#wrapper {
width: 960px;
background-color: #f1f1f1;
margin: 0 auto;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
}

#internal
{
width: 959px;
height: auto;
background-color: #f1f1f1;
margin: 0 auto;
border-right: 1px solid #ccc;
}

#content {
width: 675px;
height: auto;
float: left;
padding: 10px;
}

#sidebar {
width: 150px;
/* height: 410px; */
float: left;
background-color: #27408B;
color: white;
}

#sidebar a {
text-decoration: none;
color: white;
}

#sidebar li {
list-style: none;
}

As I said; noob. So I’m probably doing something dumb here…
I’ve tried jsfiddle, but even using the large amount of content in the about page, it renders it small, so it doesn’t affect the sidebar…
I’ve tested in Chrome and IE, both have the same issue.

  • 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-28T22:52:18+00:00Added an answer on May 28, 2026 at 10:52 pm

    This can be fixed pretty easily with your existing code. The basic method is outlined here: CSS Equal Height Columns.

    Basically, you fake it by adding your sidebar color to a wrapper div (in your case, you can use your existing #internal). Because this div actually CONTAINS the main content, it will expand as necessary. To make it look like it’s a sidebar, you then give the main content a background color that matches your body. The actual sidebar div has no background, it just holds the text. You might need to see this in action for it to really make sense, but here are the relevant bits of CSS:

    #internal {
        background-color: #27408B; /* the color you want for the sidebar */
    }
    
    #content {
        background-color: #f1f1f1; /* matches the body background */
    }
    

    And then remove the background-color line from #sidebar. (I also had to add a float to #internal and change its width to auto to get things working.)

    Here it is in JSFiddle

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

Sidebar

Related Questions

I have a menu div which changes height dynamically, depending on the content. The
I have a user control that loads other user controls dynamically. The issue is
I am coming across an issue with dynamically creating buttons. I have my text
I have ran into a very strange issue with Google Maps in Chrome 5.0.375.99:
I am creating buttons dynamically for a user-based app. Now I have to tell
After reading some of the other questions on here and trying their solutions, I
I am having an issue applying css dynamically to a loaded div using the
Having a bit of an issue accessing dynamically added DIV's immediately after they've been
So I have element blocks being added dynamically ( <div><img><div><p></p></div></div> ) and once they
I have a peculiar issue here in the Spring-GWT application we are building. We

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.