浏览器打开html页面出现Failed to load resource: the server responded with a status of 404 (Not Found)

浏览器打开html页面出现Failed to load resource: the server responded with a status of 404 (Not Found)

  • 项目场景:
  • 问题描述
  • 原因分析:
  • 解决方案:
  • 总结:

项目场景:

在学习前端的时候,我拉取了老师的html源代码,当我用idea使用浏览器浏览html5出现404。

问题描述

例如:代码没有报错,但是通过谷歌浏览器打开就是404

浏览器打开html页面出现Failed to load resource: the server responded with a status of 404 (Not Found)_第1张图片

原因分析:

右键检查打开控制台,发现报错Failed to load resource: the server responded with a status of 404 (Not Found),当前页面没有找到。
浏览器打开html页面出现Failed to load resource: the server responded with a status of 404 (Not Found)_第2张图片

解决方案:

我觉得是路径的原因,所以仔细核对了路径,发现了问题,

这是idea里面的文件路径
在这里插入图片描述

这是浏览器上方的路径,多了/jsd-2305-03-teacher,具体原因,这里应该要去了解其打开的机制。
在这里插入图片描述

总结:

大家在遇到Failed to load resource: the server responded with a status of 404 (Not Found)错误的时候,可以核对一下文件路径。

你可能感兴趣的:(html,html5,idea)