Use*_*upt 11 html url hyperlink
假设当前的URL是 example.com/test/example
让我们说我想链接到 example.com/test/example/another
<a href="/another"> 把我联系到 example.com/another
如何在example.com/test/example/another不必将完整URL放入a标记的情况下链接到?
<a href="another">
Run Code Online (Sandbox Code Playgroud)
应该这样做.
编辑:我的坏,它实际上是:
<a href="./another">
Run Code Online (Sandbox Code Playgroud)
如果您不希望使用绝对路径,我建议您使用根相对路径:
<a href="/test/example/another">Link text</a>
Run Code Online (Sandbox Code Playgroud)
否则,对于相对路径,itdoesntwork的答案将涵盖用例。
| 归档时间: |
|
| 查看次数: |
12919 次 |
| 最近记录: |