如何从两个文件夹中出来?

问题描述

Here is the output I'm getting when ever I try to go out of products.html to hom e Page.html

实际上,我有一个 Home Page.html一个文件名称示例产品,在该 >sample products 我有一个名为 products文件夹,产品内部有一个 html 文件product.html 那么我该如何访问product.html 在主页中。

就像我们知道的那样,../folder_Name,它来自一个文件夹。同样,我想从两个文件夹中出来,访问Home Page.html中的product.html >

解决方法

要访问主页中的产品页面:

在 Home Page.html 中,./sample products/products/product.html./ 表示当前目录。

在产品页面访问主页:

在 product.html 中,../../Home Page.html

,

假设您的主页位于根目录

要连接到根文件使用“/”它从根开始路径//绝对路径

/homepage.html

另一个是,

尽可能多地使用“../” //相对路径

对于单个文件夹,使用一次,两次输入两次,以此类推

../../Homepage.html