Some content div has a fixed height an...">

Height of content inside div

The page content is loaded inside a div:

<div id="content">Some content</div>

      

div has a fixed height and scrolls in case of overflow. I want to adjust the height (reduce it) on the loading div, if the content doesn't require a fixed div height. How can the height of the content inside a div be measured?

I tried to work in a different way. No fixed height and after page load measuring div height and on overflow adjusting div height to a certain maximum. But this created problems with certain images in the content that did not have the specified height and width. The browser is returning the wrong div height because the images haven't loaded yet. Even with $ (window) .ready (...

Any help is appreciated!

+2


source to share


1 answer


How easy is it max-height

to install in CSS?

And for IE6, you can use CSS expressions:



<!--[if lte ie6]>
<style>
#content {
   height: expression( this.scrollHeight > 499? "500px" : "auto" ); 
}
</style>
<![endif]-->

      

It's very ugly, but IE6 too ...

+1


source







All Articles