css图片等比例缩放实例

 代码如下 复制代码

<style type=”text/css”>
.thumbImage img{
MAX-WIDTH: 100%!important;HEIGHT: auto!important;width:expression(this.width > 600 ? “600px” : this.width)!important;
}
.thumbImage {MARGIN: auto;WIDTH: 600px;}
*html.thumbImage img{
width:expression(this.width>600&&this.width>this.height?450:auto);
height:expresion(this.height>450?450:auto);
}
</style>

html代码

 代码如下 复制代码

<body>
<DIV  class=”thumbImage” ><img  src=”2007910112041114.jpg”  border=”0″></DIV>
</body>

这样只要在 class中thumbImage图片都会等比例缩放哦,小了就原始显示大的就等比例缩小。

css图片等比例缩放实例

相关文章:

你感兴趣的文章:

标签云: