【问题标题】:Why I have the error Failed to load resource: net::ERR_FILE_NOT_FOUND?为什么我有错误加载资源失败:net::ERR_FILE_NOT_FOUND?
【发布时间】:2021-05-01 19:22:48
【问题描述】:

我正在使用引导程序制作表单,当我从文件夹中打开我的 HTML 文件时出现以下错误并且样式未加载 error

但是当我在 Visual Studio Code 中使用 Live Server 打开 HTML 时,所有内容都是 Oklive server

为什么会发生,我该如何解决?这是我的代码:

 <!-- Bootstrap CSS -->
<link rel="stylesheet" href="/practica bootstrap-copia/css/bootstrap.min.css">
<link rel="stylesheet" href="/practica bootstrap-copia/form.css">
<link href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;800&display=swap" rel="stylesheet">

<title>Arma tu cv</title>
<!-- BOOTSTRAP AND JS -->
<script src="/practica bootstrap-copia/js/bootstrap.min.js"></script>
<script src="/scripts.js"></script>

my folders

感谢您的关注。

【问题讨论】:

  • 这个:/practica bootstrap-copia/css/bootstrap.min.css 包含一个空格字符。不要在将使用hrefsrc 访问的目录或文件名中使用空格。这会导致问题。

标签: javascript html css bootstrap-4 styles


【解决方案1】:

我重现了您的问题并找到了解决方案。删除您的 hrefs 中的前导斜杠。它们需要是相对目录位置,而不是绝对位置。

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="practica bootstrap-copia/css/bootstrap.min.css">
<link rel="stylesheet" href="practica bootstrap-copia/form.css">
<link href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;800&display=swap" rel="stylesheet">

<title>Arma tu cv</title>

【讨论】:

    猜你喜欢
    • 2015-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多