This content originally appeared on DEV Community and was authored by Isa Macedo
<base>
Utilidades:
- Definir a URL base para os caminhos relativos da página; 
- Estabelecer a propriedade target dos links, sem que precise especificar em cada tag. 
Características:
A tag <base> só pode ser utilizada 1 vez dentro do HTML e deve ser inserida dentro da tag <head>.
Ela deve ter necessariamente o atributo href ou o atributo target, mas pode ter os dois também.
Forma(s) de aplicar:
Com href (para estabelecer a URL base):
  <head>
    <base href="https://www.site.com/">
  </head>
  <body>
    <a href="login">Login</a>
  </body>
Com target (para definir que todos os links abram em nova página, por exemplo):
  <head>
    <base target="_blank">
  </head>
  <body>
    <a href="https://www.site.com/login">Login</a>
  </body>
Com href e target (para definir a URL base e a forma que vai abrir os links):
  <head>
    <base href="https://www.site.com/" target="_blank">
  </head>
  <body>
    <a href="login">Login</a>
  </body>
Por que usar a tag <base>?
Pra simplificar o código, já que acaba deixando o código um pouco menor, sem tantas repetições da URL e fica mais legível também.
Fontes:
Tag Base - MDN
This content originally appeared on DEV Community and was authored by Isa Macedo
 
	
			Isa Macedo | Sciencx (2021-11-18T01:50:32+00:00) HTML Tag <base>. Retrieved from https://www.scien.cx/2021/11/18/html-tag-base/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.
