版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_38497634/article/details/89554837
代码:
<html>
<head>
<style type="text/css">
#mydiv{
width:120px;
height:86px;
overflow:hidden;
display:table-cell;
vertical-align:middle;
text-align:center;
}
#mydiv img{
max-width:120px;
max-height:86px;
}
</style>
</head>
<body>
<table border="1">
<tr>
<td>
<div id="mydiv">
<span>
<img src="C:\Users\cuiyueyang\Desktop\11111.jpg" />
</span>
</div>
</td>
<td>sdfasddddddddddddddddddddddddddddddddddddddddddd</td>
</tr>
</table>
</body>
</html>
结果: