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

Summary of MySQL date and time functions (MySQL 5.X)

1. MySQL gets the current date and time function ...

Textarea tag in HTML

<textarea></textarea> is used to crea...

Problems and solutions when replacing Oracle with MySQL

Table of contents Migration Tools Application tra...

IIS7 IIS8 http automatically jumps to HTTPS (port 80 jumps to port 443)

IIS7 needs to confirm whether the "URL REWRI...

Analysis of MySQL example DTID master-slave principle

Table of contents 1. Basic Concepts of GTID 2. GT...

Teach you how to build Tencent Cloud Server (graphic tutorial)

This article was originally written by blogger We...

Detailed explanation of psql database backup and recovery in docker

1. Postgres database backup in Docker Order: dock...

Comprehensive understanding of line-height and vertical-align

Previous words Line-height, font-size, and vertica...

How to use the Linux nl command

1. Command Introduction nl (Number of Lines) adds...

How to install and configure WSL on Windows

What is WSL Quoting a passage from Baidu Encyclop...

CSS sets the box container (div) height to always be 100%

Preface Sometimes you need to keep the height of ...

JavaScript to achieve dynamic color change of table

This article shares the specific code for JavaScr...