【问题标题】:How to link css to html with this pathway (image)如何使用此路径将 css 链接到 html(图片)
【发布时间】:2017-12-23 23:12:23
【问题描述】:

Pathway image

我想将 style.css 链接到我的 html 页面 ATC1O.html。我在 'href="' 之后添加了更多句点,但这不起作用。有没有办法将其链接起来?

<link rel="stylesheet" href="../css/style.css">

【问题讨论】:

    标签: html css path


    【解决方案1】:

    试试“../../css/style.css”或“../../../css/style.css”。

    很难从您的图像中了解 ATC10.html 的深度。我只知道它不是直接父母。

    【讨论】:

    • ../../../css/style.css 工作了谢谢你我被困了一个小时。谢谢!
    【解决方案2】:

    尝试以下方法:

    <link rel="stylesheet" href="./css/style.css">
    

    more info here

    【讨论】:

      【解决方案3】:
      ../../../css/style.css
      

      ./代表当前目录,所以这是dance

      ../ 代表父目录,所以这将是 art

      ../../代表Parent的父目录,所以document

      ../../../ 代表Parent的父级父目录,图中没有显示,但它包含“document”和“css”目录。所以我们进入它,然后选择 /css/style.css 文件。

      希望这不会令人困惑!

      【讨论】:

        猜你喜欢
        • 2019-11-11
        • 2017-04-05
        • 1970-01-01
        • 2018-02-17
        • 2011-11-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多