如何设置当前文件夹的相对路径? [英] How to set relative path to current folder?

查看:121
本文介绍了如何设置当前文件夹的相对路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说我目前在: http://example.com/folder/page.html

是否可以在此页面上创建指向 http://example.com/folder/的相对链接,而无需在任何地方指定 folder ?(并且仅使用HTML.)

Is it possible to create a relative link on this page that points to http://example.com/folder/ without specifying folder anywhere? (And using only HTML.)

更新:事实证明, ./仅适用于非严格doctype模式,而.则适用于两种模式,所以我认为这仍然是一个更好的答案:)谢谢大家.

UPDATE: As it turned out ./ works only in non-strict doctype mode, while . works in both modes, so it is still a better answer in my opinion :) Thanks everybody.

推荐答案

仅点在工作.doctype会有所不同,但是有时./也可以.

Just dot is working. The doctype makes a difference however as sometimes the ./ is fine as well.

<a href=".">Link to this folder</a>

这篇关于如何设置当前文件夹的相对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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