gpt4 book ai didi

html - 为什么我的 CSS 文件没有链接到我的 HTML 文件?

转载 作者:行者123 更新时间:2023-11-28 15:57:26 25 4
gpt4 key购买 nike

这是我正在使用的路径 - /public_html/websystems/websystems.css

我尝试链接的 HTML 文件位于 public_html 目录中,名为 index.html

我尝试链接的 CSS 文件位于 websystems 目录中,名为 websystems.css

文件内容如下图所示。

HTML 文件 enter image description here

CSS 文件 enter image description here

为什么我在 CSS 文件中设置的样式都没有应用于我的 HTML 文件?

感谢您的帮助。

最佳答案

试试这个,

websystems/websystems.css


请注意,(取自 Quick Reminder About File Paths)

  • Is the image in the same directory as the file referencing it?
  • Is the image in a directory below?
  • Is the image in a directory above?

By "below" and "above", I mean subdirectories and parent directories. Relative file paths give us a way to travel in both directions. Take a look at my primitive example: enter image description here

Here is all you need to know about relative file paths:

  • Starting with "/" returns to the root directory and starts there
  • Starting with "../" moves one directory backwards and starts there
  • Starting with "../../" moves two directories backwards and starts there (and so on...)
  • To move forward, just start with the first subdirectory and keep moving forward

关于html - 为什么我的 CSS 文件没有链接到我的 HTML 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46094827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com