CSS实现自动等比例缩略图的方法

 完美解决自动缩略图的代码,以实现对原图的等比例收缩。

代码如下:

.thumbImage{ max-width:50px; max-height:50px; } 
*html.thumbImage{width:expression(this.width>50&&this.width>this.height?50:auto); 
height:expresion(this.height>50?50:auto); }

 


说明: 这段代码是把图片等比例缩小为50px * 50px


本文来自:站长学习网(www.zxx6.com) 原文链接:http://www.zxx6.com/bencandy.php?fid-39-id-4034-page-1.htm

你可能感兴趣的:(html,PHP,css)