IE6で max-width, max-height を実現
しようとして以下のコードを書いたら固まった。使えない。
.image-box { width: 150px; height: 120px; border: none; border-collapse: collapse; table-layout: fixed; } .image-box td { padding: 0; line-height: 0; text-align: center; vertical-align: center; } .image-box img { max-width: 100%; max-height: 100%; } * html .image-box img { width: expression( (this.width <= 150) ? ( this.style.width = "auto" ) : ( (this.width/this.height > 150/120) ? ( this.style.width = "150px" ) : ( this.style.width = (120*this.width/this.height) + "px" ) ) ); height: expression( (this.height <= 120) ? ( this.style.height = "auto" ) : ( (this.width/this.height > 150/120) ? ( this.style.height = (150*this.height/this.width) + "px" ) : ( this.style.height = "120px" ) ) ); }