Reputation: 11859
On page /foo
I would like to link to /foo/bar
. <a href="./foo/bar">
works, except that it requires me to know that I'm currently on /foo
.
Is there a way that I can just append a suffix without needing to know the current path?
Upvotes: 1
Views: 262
Reputation: 2409
At "html" "head" you can define base path and all other hrefs can be relative to this base. Some examples of "base" tag:
<base href="https://www.example.com/">
<base target="_blank">
<base target="_top" href="https://example.com/">
Upvotes: 1