假设当前网址为example.com/test/example
我们想要链接到example.com/test/example/another
<a href="/another">
将我链接到example.com/another
如何在不必将完整网址放入example.com/test/example/another
标记的情况下关联到a
?
答案 0 :(得分:7)
<击> 撞击>
<击><a href="another">
应该这样做。
击>
<a href="./another">
答案 1 :(得分:3)
如果您不想使用绝对路径,我建议使用根相对路径:
<a href="/test/example/another">Link text</a>
否则,对于相对路径,itdoesntwork的答案涵盖用例。
答案 2 :(得分:-2)
您可以尝试:href="another"