试图从文件夹结构更深的另一个 html 页面 link 到 index.html

trying to link to index.html from another html page deeper in the folder structure

我正在尝试获得一些基本的东西来在这里工作。我的根目录中有一个索引页和另一个名为 collections 的文件夹。在集合中,我有另一个包含 'MA.html' 的文件夹 'MA'。我只想 link MA.html 回到 index.html。我有一个锚点 link 'back' 试图这样做,但单击它只会再次重新加载 MA.html。我还是网络开发的新手,所以请对我放轻松。我正在添加我的文件夹结构的图像。

这是我的 HTML -

<div class="info overlay">
     <div class="text">
        <a href="/collections/MA/MA.html">MA</a>
        <a href="/collections/capsule.html">Capsule</a>
        <a href="/collections/BA/BA.html">BA</a>
     </div>
     <a href="/index.html" class="info-back">Back</a>
  </div>

在index.html

<a href="./collections/MA/MA.html">MA</a>

这和以前一样,一旦你降落在 MA.html,你想回到 index.html 所以-

在MA.html

<a href="../../index.html">link</a>

..(双点)表示'go up a directory level'。

尝试在调用目录之前删除 /

<a href="./collections/MA/MA.html">redirect</a> 这将使您可以将 index.html 连接到 MA.html。