基本的HTML - 如何设置当前文件夹的相对路径? [英] Basic HTML - how to set relative path to current folder?
问题描述
可以说我目前在:
http://example.com/folder/page.html
是否可以在此页面上创建相对链接,指向 http://example.com/folder/
,而不指定文件夹
在任何地方? (仅使用HTML)。
更新:
事实证明 ./
只能在非严格的doctype模式下使用,而。
在两种模式下都可以使用,所以在我看来它仍然是更好的答案:)
Thanks everyone。
doctype有所不同,但有时候./也很好。
< a href =。>链接到此文件夹< / a>
Lets say I am currently at:
http://example.com/folder/page.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.)
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.
Just dot is working. The doctype makes a difference however as sometimes the ./ is fine as well.
<a href=".">Link to this folder</a>
这篇关于基本的HTML - 如何设置当前文件夹的相对路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!