CSS按比例缩小图片(缩略图),FF和IE7用 max-width max-height,IE6用expression。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function ResumeError() { return true; }
window.onerror = ResumeError; //屏蔽JS错误,这样状态栏就不会显示“网站上有错误了”
</script>
<style type="text/css" >
.album-pic-list img {
vertical-align: middle;
max-width:100px; /* FF IE7 */
max-height:100px; /* FF IE7 */
_width:expression(this.width > 100 && this.width > this.height ? 100: auto); /* IE6 */
_height:expression(this.height > 100 ? 100 : auto); /* IE6 */
}
</style>
</head>
<body>
<div class="album-pic-list">
<img src="pic/pic_03.jpg" />
<img src="pic/lo2.jpg" />
</div>
</body>
</html>