If I set my base url like so:
<base href='http://example.com' />
And then put a link to an anchor on the page http://example.com/test.php:
<a href='#top'></a>
How do I make sure the anchor stays on the same page and goes to the link http://example.com/test.php#top as opposed to going to http://example.com/#top because it uses the base url?
Essentially, is there any way to specify that this particular link must be relative and not use the base?
You could either do:
<base href='http://example.com' />
<a href='test.php#top'></a>
or
<base href='http://example.com/test.php' />
<a href='#top'></a>
I don't think there is any magic way that the client is going to know what file to use as part of the base if you don't define it.
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