如何使用a-href标签链接回文件夹? [英] How do I link back out of a folder using the a-href tag?

查看:51
本文介绍了如何使用a-href标签链接回文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我在文件夹中有一个页面,该页面称为Jobs.html,而该文件夹简称为"jobs".它是我的网站"文件夹的子文件夹.在主"文件夹的主目录中是我的"home.html"文件.当我尝试做

Alright so I have a page in a folder, the page is called jobs.html and the folder is simply called "jobs". Its a sub folder of my mine "website" folder. In the main directory of the "main" folder is my "home.html" file. When I try to do

<a href="home.html">bla</a>

它正在寻找作业文件夹中的主文件,因此不起作用.

It malfunctions as it is looking for the home file in the jobs folder, which does not exist.

所以我问,如何从文件夹中引用从根文件夹中调用文件?

So I ask, how can I reference out of a folder to call a file from the root folder?

推荐答案

尝试将链接设置为站点根目录;注意 home.html 前面的/:

Try setting your link to be your site root as so; note the / in front of home.html:

<a href="/home.html">bla</a>

或者,如果您知道该路径肯定是向下一个目录,则只需明确告诉它向下一个目录即可;注意 home.html 前面的 ../.

Or if you know the path is definitely one directory down then just explicitly tell it to go down 1 directory; note the ../ in front of the home.html.

<a href="../home.html">bla</a>

这篇关于如何使用a-href标签链接回文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆