Skip to content

Instantly share code, notes, and snippets.

@kainy
Created October 9, 2013 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kainy/6897790 to your computer and use it in GitHub Desktop.
Save kainy/6897790 to your computer and use it in GitHub Desktop.
通过vml解决IE下图片缩小失真(有锯齿)的问题。
<!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" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>解决IE下图片缩小失真(有锯齿)的问题_西山刀客</title>
<style>
img{ width:24px; height:24px;}
.ie7{-ms-interpolation-mode:bicubic;display:none;}
.ie{behavior:url(#default#VML); display:inline-block; width:24px; height:24px;}
</style>
<!--[if IE ]>
<style>
.normal{display:none;}
</style>
<![endif]-->
<!--[if IE 7 ]>
<style>
.ie7{display:inline-block;}
.ie{display:none;}
</style>
<![endif]-->
</head>
<body>
<br>对照:
<img src="http://a.kainy.cn/c/kainy.jpg"/>
<br>非ie:
<img src="http://a.kainy.cn/c/kainy.jpg" class="normal"/>
<br>ie7:
<img src="http://a.kainy.cn/c/kainy.jpg" class="ie7" />
<br>ie:
<v:image src="http://a.kainy.cn/c/kainy.jpg" class="ie"/>
<br><br><br><br><br><br><br><br>原文:http://blog.sina.com.cn/s/blog_448f59f301019pkh.html
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment