An underrated HTML tag

An underrated HTML tag

I learnt this from This is an amazing post.

So basically, the tag is the <base></base> tag. It is used like this:

<base href=”" target=”_blank”>
<a href="a-post.html">A post</a>

So if the base is mentioned earlier, all the relative links will be according to this. This is very useful when you are using a tool like site sucker, which saves files from a webpage. Some resources like images might not be correctly displayed if you saved a single file locally, but it will if you add the base tag, telling the html file that all the media files with relative links are from this webpage.

An example:

Leave a Reply

Your email address will not be published. Required fields are marked *