E
Erik Ginnerskov
I have been struggling for some time, trying to make IE behave as if it
actually understand the css attribute max-height.
In fireFox this code vill work perfectly:
<div style="width: 300px; max-height: 60px; overflow:auto">Some
text</div>
If the amount of text isn't enough to fill out the space, the box decreases
til fit the text. If the amount of text exceeds the height defined, the box
will get a scroll bar.
IE does not understand that and the height of the box depends solely on the
amount of content.
I have come up with a hack (placed in header), that limits the height in IE
too:
<!--[if IE]>
<style type="text/css" media="screen">
#maxi {
height:expression(
document.body.clientHeight > (100/12) *
parseInt(document.body.currentStyle.fontSize)?
"60px":
"auto" );
}
</style>
<![endif]-->
But when the amount of text doesn't fill out the specified height, all that
happens is, the scroll bar dissapears. The box is still at the max height.
Anyone who knows how to make IE do as wanted?
actually understand the css attribute max-height.
In fireFox this code vill work perfectly:
<div style="width: 300px; max-height: 60px; overflow:auto">Some
text</div>
If the amount of text isn't enough to fill out the space, the box decreases
til fit the text. If the amount of text exceeds the height defined, the box
will get a scroll bar.
IE does not understand that and the height of the box depends solely on the
amount of content.
I have come up with a hack (placed in header), that limits the height in IE
too:
<!--[if IE]>
<style type="text/css" media="screen">
#maxi {
height:expression(
document.body.clientHeight > (100/12) *
parseInt(document.body.currentStyle.fontSize)?
"60px":
"auto" );
}
</style>
<![endif]-->
But when the amount of text doesn't fill out the specified height, all that
happens is, the scroll bar dissapears. The box is still at the max height.
Anyone who knows how to make IE do as wanted?