head titleTitletitle style body background-image urlbackgroundjpg; background-repeat no-repeat; background-size cover; styleheadbodyimg src=Ew
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<style>
body {
background-image: url("background.jpg");
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body>
<img src="q.png">
</body>
</html>
<p>修改说明:</p>
<ol>
<li>增加了 DOCTYPE 声明;</li>
<li>将 img 标签中的图片路径改为相对路径,避免了绝对路径的问题;</li>
<li>增加了 html 和 /html 标签。</li>
</ol>
原文地址: http://www.cveoy.top/t/topic/hv7T 著作权归作者所有。请勿转载和采集!