【问题标题】:i fail to get my css file to link it with the index file我无法让我的 css 文件将其与索引文件链接起来
【发布时间】:2021-12-03 10:42:46
【问题描述】:

根文件是Practise2文件夹:

-Resources (folder)
-php_script (folder)
-index.php (file)

在资源文件中:

-html (folder)
-styles (folder)
-images (folder)

在样式文件夹中:

-login.css (file)

我想把 login.css 文件和 index.php 文件链接起来

index.php 链接代码…

<link rel="stylesheet" href="/Resources/styles/login.css">

【问题讨论】:

  • 您可以添加您的目录的屏幕截图以便更容易理解吗?
  • 还要添加实际包含css文件的代码。 Web 服务器文档根目录是哪个文件夹?
  • 试试href="styles/login.css" 然后它是相对于PHP文件的

标签: html css relative-url


【解决方案1】:

尝试在之前的 Resources 文件夹中添加一个点。

<link rel="stylesheet" href="./Resources/styles/login.css">

【讨论】:

  • 非常感谢,成功了。
猜你喜欢
  • 2014-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-08-13
  • 1970-01-01
  • 2011-01-13
  • 2020-11-01
  • 1970-01-01
相关资源
最近更新 更多