Imagine a website located at http://example.com/myWebsite/.
I would like my absolute paths to point to myWebsite directory.
I know one can do it for relative links with the base tag, but I wish to keep the default behavior for relative links.
Is there something useful I can specify in head ?
<!DOCTYPE html>
<html>
<head>
<base href="http://example.com/myWebsite/" target="_blank">
</head>
<body>
<p><img src="stickman.gif" width="24" height="39" alt="Stickman"> -
Notice that we have only specified a relative address for the image.
Since we have specified a base URL in the head section, the browser will
look for the image at "http://example.com/myWebsite/stickman.gif".
</p>
</body>
</html>
Use this
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