This is a stupidly easy question, however after searching for a long time I have yet to yield any results.
My question is as follows.
I have a webpage with the url http://domain.com/mypage/ladeda/
I have a link on this page.
<a href="/1/">Page 1</a>
That link sends me to http://domain.com/1/
<a href="1/">Page 1</a>
That link takes me to http://domain.com/mypage/1/
How do i get my link to take me to http://domain.com/mypage/ladeda/1/
without having to extract all the aspects of the page url and put them within the href.
Many Thanks
Complete HTML/CSS Course 2022 To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links.
Paste the URL parameter to the end of the URL in the text editor. Copy the full URL with the appended URL parameter. Post the URL to the desired location. The location is the place from which you would like applicants to be able to see and click the link.
Anchor URL Therefore ensure that your intended external URL does not contain a number sign, or that you have not mistakenly included one in your code. By default, anchor links with no preceding URL value will result in the hyperlink being appended to the current URL.
The href attribute specifies the URL of the page the link goes to. If the href attribute is not present, the <a> tag will not be a hyperlink.
<base href="/mypage/ladeda/" />
...
<a href="1/">(goes to http://domain.com/mypage/ladeda/1/)</a>
Via the <base>
element.
But!<a href="1/">Page 1</a>
should take you to http://domain.com/mypage/ladeda/1/
already provided that (a) you don't use a <base>
element already and (b) the current resource is really http://domain.com/mypage/ladeda/
(with a trailing slash).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With