网页图片垂直剧中 等比例缩放 黑白显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//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=utf-8" />
<title>无标题文档</title>
</script>
<style type="text/css">
<!--
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
}


img
{
 
 width: expression_r(this.width > 200&& this.width >this.height ? 200 : true);
 height: expression_r(this.height >160 ? 200 : true);
 
 max-width:200px;max-height:160px;
 min-width:0px;min-height:0px;
 
 position:static;
 +position:relative;
 top:-50%;left:-50%;
filter: Gray;
}

div
{
 width:500px;
 height:360px;
 background:#000;
 overflow:hidden;
 position:relative;
 display:table-cell;
 text-align:center;
 vertical-align:middle;

}

p
{
 
  position:static;
  +position:absolute;
  top:50%;
  background-color:#0F0;
}
-->
</style></head>
<body>
<div><p><ahref="#"><imgsrc="Chrysanthemum.jpg"/></a></p></div>
</body>
</html>

 

posted @ 2014-10-21 13:13  dcrenl  阅读(245)  评论(0编辑  收藏  举报