html文件代码如下:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>动手纠错1</title>
<style>
.content{
width: 278px;
height: 188px;
margin-top: 226px;
margin-left: 1014px;
}
</style>
</head>
<!--设置页面的背景图片-->
<body background="../images/1.jpg">
<div class="content">
<span>小新AIR12</span>
<h1>简约设计 金属机身</h1>
<span>12.2英寸|13.4mm轻薄时尚本Core-M|4G</span>
<h1></h1>
<span>128G SSD|1.2kg</span>
</div>
</body>
</html>
浏览器显示页面:

检查后报错:

根据检查报告的错误,很明显是加载源文件失败:错误_文件_未找到。
解决方案如下代码所示(将background后引用的路径“../images/1.jpg”更改为“images/1.jpg”)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>动手纠错1</title>
<style>
.content{
width: 278px;
height: 188px;
margin-top: 226px;
margin-left: 1014px;
}
</style>
</head>
<!--设置页面的背景图片-->
<body background="images/1.jpg">
<div class="content">
<span>小新AIR12</span>
<h1>简约设计 金属机身</h1>
<span>12.2英寸|13.4mm轻薄时尚本Core-M|4G</span>
<h1></h1>
<span>128G SSD|1.2kg</span>
</div>
</body>
</html>
更改后效果如图:

本人于2023年1月24日03:09:57完成实践并撰写本文章,特于此记录并分享。
© 版权声明
文章版权归作者所有,如需转载请联系作者。若文章内容侵犯了您的权益,请通过网站底部联系方式联系我们处理(本站具有最终解释权)。如有不便之处,敬请谅解。
THE END
暂无评论内容