-1

我的index.html文件在public_html目录中。所有 css 文件/图像文件分别位于 css 目录和 images 目录中。

我一遍又一遍地重复我的代码,但索引没有与托管中的任何内容链接。`

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/flexslider.css">
<link rel="stylesheet" href="css/jquery.fancybox.css">
<link rel="stylesheet" href="main.css">   // ***
<link rel="stylesheet" href="css/responsive.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/font-icon.css">`

*** 我将main.css 文件直接移到其中public_html,看看它是否可以工作并且确实可以。我只能假设我在我的道路上犯了一个错误。

顺便说一句,我在.css 路径中添加了 / href。我不想将所有内容都移动到public_html我将其作为根目录的文件夹中

非常感谢

4

1 回答 1

0

这可能是多余的,但一种可能的解决方法是在./任何地方使用。例如。

<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/flexslider.css">
<link rel="stylesheet" href="./css/jquery.fancybox.css">
<link rel="stylesheet" href="./main.css">   // ***
<link rel="stylesheet" href="./css/responsive.css">
<link rel="stylesheet" href="./css/animate.min.css">
<link rel="stylesheet" href="./css/font-icon.css">

它应该工作。

假设css文件夹 和main.css是插入此代码的 HTML 文件的兄弟姐妹。

于 2017-10-26T18:07:55.457 回答