What is the base tag and what does it do?

What is the base tag and what does it do?

The <base> tag specifies the default address or default target for all links on a page.
Normally, browsers fill in the blanks in relative URLs by extracting the corresponding elements from the URL of the current document.
Use the <base> tag to change this. The browser will then resolve all relative URLs using the specified base URL instead of the current document's URL. This includes URLs in <a>, <img>, <link>, and <form> tags.

test:

1: The link path placed before the base tag can use a relative path and is relative to the current path.
However, the link placed after it using a relative path will be relative to the path specified by base.
2: After using the base tag, the relative path of the link in the body will be relative to the path specified by base.
3: After using the base default target, the subsequent opening method will be opened in the method specified by base, unless the opening method is explicitly defined later.
Summary: base actually defines a default address and default target. All subsequent link elements will work.

<<:  Attributes in vue v-for loop object

>>:  Nginx reverse proxy to go-fastdfs case explanation

Recommend

Detailed explanation of how to use the vue3 Teleport instant movement function

The use of vue3 Teleport instant movement functio...

Explanation of the working principle and usage of redux

Table of contents 1. What is redux? 2. The princi...

Detailed explanation of Linx awk introductory tutorial

Awk is an application for processing text files, ...

When to use Map instead of plain JS objects

Table of contents 1. Map accepts any type of key ...

About the pitfall record of Vue3 transition animation

Table of contents background Problem location Fur...

Detailed explanation of the installation process of Jenkins on CentOS 7

Install Jenkins via Yum 1. Installation # yum sou...

Differences between FLOW CHART and UI FLOW

Many concepts in UI design may seem similar in wo...

JavaScript offsetParent case study

1. Definition of offsetParent: offsetParent is th...

How to implement adaptive container with equal aspect ratio using CSS

When developing a mobile page recently, I encount...

HTML background color gradient achieved through CSS

Effect screenshots: Implementation code: Copy code...

Detailed explanation of the usage of the alias command under Linux

1. Use of alias The alias command is used to set ...

WeChat applet development form validation WxValidate usage

I personally feel that the development framework ...