问题描述
实际上,我有一个 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