I just found out about the <base>
HTML tag. I have never seen it actually used anywhere before. Are there pitfalls to its use that means I should avoid it?
The fact that I have never noticed it in use on a modern production site (or any site) makes me leery of it, though it seems like it might have useful applications for simplifying links on my site.
Edit
Conclusion: Probably should avoid it if you have an alternative. It could create subtle inconsistencies
There are some major gotchas with using the base tag that make it much less desirable than it first appears. Essentially, the changes to href='#topic'
and href=''
under the base tag are very incompatible with their default behavior, and this change from the default behavior could easily make third party libraries outside of your control very unreliable in unexpected ways, since they will logically depend on the default behavior.
I accepted the top answer before I had all the information, and after having used it myself for a few weeks, discovered the incompatibilities that make the base tag something that I recommend you DON'T USE, see my answer below for the details.