我正在使用 Chrome 并且代码工作正常,但是,当我将其加载到 Internet Explorer 中时,它会以实际大小显示图像,而不是缩放以适应屏幕。我希望图像位于页面的左侧并从上到下覆盖,而不是从左到右。我希望它保持不变,以便正确缩放图像。这就是我所拥有的。有没有更简单的方法?我使用的是 Internet Explorer 8。预计到达时间:图像为 340x554px
<!DOCTYPE html>
<html>
<head>
<style>
body{
background-color:#000000;
}
#logo{
top:0;
bottom:0;
left:0;
position:absolute;
background-image:url('logo.jpg');
background-size: contain;
-webkit-background-size: contain;
-moz-background-size: contain;
-o-background-size: contain;
background-repeat:no-repeat;
height:100%;
width:100%;
}
</style>
<title>Title</title>
</head>
<body>
<div id="logo">
</div>
</body>
</html>