浏览器:Chrome(以 100% 显示) 桌面显示器:4K
当显示 Jpeg 时,浏览器显示的大小大约是应有大小的两倍。就像放大了一样。下面是HTML代码和样式表:
<!DOCTYPE html>
<html>
<head>
<title>
Testing
</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<img src="images/Home.jpg" width="3840" height="2560">
</body>
</html>
body{
margin: 0;
}
最佳答案
尝试一下
<!DOCTYPE html>
<html>
<head>
<title>
Testing
</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<style>
.body_img{
width: 100%;
}
</style>
</head>
<body>
<img src="images/Home.jpg" class="body_img">
</body>
</html>
关于html - 显示 Jpeg 时,浏览器显示的大小约为应有大小的两倍,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57070014/