相対パスとは
インターネット上の"http://…"から始まるリンクは、どこから検索しても位置が変わらないため絶対パス指定と呼ばれています。
対して、現時点いるファイルを基準としてリンクを指定する方法を相対パス指定と呼びます。
現時点より下にあるフォルダーにあるファイルを指定する場合は、降りる数だけ/で区切ってフォルダー名を書きます
2つ下の例) フォルダー名/フォルダー名/ファイル名
現時点より上にあるフォルダーにあるファイルを指定する場合は、上がる数だけ../で区切ります。
1つ上の例) ../ファイル名
≪ 各ファイルのディレクトリ位置 ≫
「index.html」ファイルの場合(Aフォルダ)
<body>
<a href="B/page1.html">page1</a>へ
<a href="C/page2.html">page2</a>へ
<a href="C/D/page3.html">page3</a>へ
</body>
「page1.html」ファイルの場合(Bフォルダ)
<body>
<a href="../C/page2.html">page2</a>へ
<a href="../C/D/page3.html">page3</a>へ
<a href="../index.html">index</a>へ戻る
</body>
「page2.html」ファイルの場合(Cフォルダ)
<body>
<a href="../B/page1.html">page1<a>へ
<a href="D/page3.html">page3<a>へ
<a href="../index.html">index<a>へ戻る
</body>
「page3.html」ファイルの場合(Dフォルダ)
<body>
<a href="../../B/page1.html">page1</a>へ
<a href="../page2.html">page2</a>へ
<a href="../../index.html">index</a>へ戻る
</body>