Posts tagged "base"

The HTML Base element

The HTML <base> element specifies attributes for all links in the document at once.
Let's take a look at this example:

  <base target="_blank">

Now all links will open in a new tab by default.

Additionally, the href attribute can be set within <base> tag. This sets the base URL to be used throughout the document for relative URL addresses.

For example:

  <base href="">

The following link:

  <a target="_blank" href="#Usage_notes">Usage notes</a>

Will actually point to


  • <base> shouldn't have a closing tag. 🤷
  • There can be only one base element in a document.

More info ℹ️