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

<!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=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><a href="#"><img src="Chrysanthemum.jpg"/></a></p></div>
</body>
</html>

posted @   dcrenl  阅读(305)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示