I'm having a problem with content heights inside a box that acts as a border. I essentially have an internal content box and a sidebar on top of a background box. The background box inherits it's height from the internal content box, which inherits it's height from the content itself. The problem is that because the sidebar does not have the same amount of content as the internal content box, the sidebar's height does not match the internal content box's height. I wrote a small script in jQuery to fix it, but it isn't cross-browser compatible.

```javascript
jQuery(function(){
  var pageHeight = jQuery('div#internalcontent').height();
  jQuery('div#sidebar').css('height', pageHeight);
});

```

This code works in Chrome sometimes, but usually fails in Firefox. I assume it has something do with the way the page is loading - eg all the elements aren't loaded when the page height is assigned.

Does anyone know a way to do this in CSS, or fix it in javascript? Thanks.