An underrated HTML tag

An underrated HTML tag

I learnt this from https://itnext.io/html-underrated-tags-119ef3e45b94. This is an amazing post.

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

<base href=”https://www.example.com/" 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:

https://codepen.io/adrian-legaspi/pen/qBErzEq

Leave a Reply

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