Posted By

charmcitycoder on 04/20/09


Tagged

ie ie6 min-height Expression max-height


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

charmcitycoder


IE 6 Min/Max height using "expression"


 / Published in: CSS
 

URL: http://perishablepress.com/press/2007/01/16/maximum-and-minimum-height-and-width-in-internet-explorer/

Thanks to perishablepress.com for this. Below is an example for ie6 max-height.

From their site: "This method has been verified in IE6 and should also work in IE5. Simply change the values to suit your needs (code commented with explanatory notes). In this example, we are setting the max-height at 333px 1 for IE and all standards-compliant browsers:"

  1. * html div#mySelector{
  2. height: expression( this.scrollHeight > 332 ? "333px" : "auto" ); /* sets max-height for IE */
  3. }
  4.  
  5. div#mySelector{
  6. max-height: 333px; /* sets max-height value for standards-compliant browsers */
  7. }

Report this snippet  

You need to login to post a comment.