Home Web Front-end HTML Tutorial What is the function of base tag in html

What is the function of base tag in html

Jan 31, 2019 pm 04:44 PM
base base tag

What is the role of the base tag in html?

Function: Specifies the default address or default target for all links on the page. It is a label that expresses the path and connection URL.

Note: Normally, the browser will extract the corresponding elements from the URL of the current document to fill in the blanks in the relative URL. This can be changed using the tag. The browser will then no longer use the URL of the current document, but will use the specified base URL to resolve all relative URLs. This includes URLs in , , ,

tags.

Note: In HTML, the tag does not have a closing tag; in XHTML, the tag must be closed correctly. The tag must be inside the head element.

html base tag example

<head>
<base href="http://www.php.cn/tpl/Index/Static/img/" />
<base target="_blank" />
</head>
<body>
<img src="banner7.jpg" /><br />
<p>请注意,我们已经为图像规定了一个相对地址。由于我们已经在 head 部分规定了一个基准 URL,浏览器将在如下地址寻找图片:</p>
<p>"http://www.php.cn/tpl/Index/Static/img/banner7.jpg"</p>
<br /><br />
<p><a href="http://www.php.cn">php中文网</a></p>
<p>请注意,链接会在新窗口中打开,即使链接中没有 target="_blank" 属性。这是因为 base 元素的 target 属性已经被设置为 "_blank" 了。</p>
</body>
</html>
Copy after login


The above is the detailed content of What is the function of base tag in html. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Base DEX Faucet: Aerodrome VS Curve Base DEX Faucet: Aerodrome VS Curve Mar 26, 2024 pm 04:31 PM

The Velodrome model is inspired by veCRV and aims to achieve superior consistency among the three key participants of DEX, including liquidity providers (LPs), token holders, and projects that require liquidity. However, many participants in the DeFi field still do not fully understand the underlying reasons. By reading this article in-depth, you will be able to get out of this dilemma and get to the bottom of it. Today we will discuss Velodrome/Aerodrome, a real success story in the DeFi field. This article will compare the two models and explain how Velodrome improves on the veCRV model and what significant impact these small differences have. First, let me state

Use regular expressions in golang to verify whether the input is a legal base64 string Use regular expressions in golang to verify whether the input is a legal base64 string Jun 24, 2023 am 10:01 AM

In Golang programming, it is a relatively common requirement to use regular expressions to verify whether the input is a legal base64 string. For developers, regular expressions can be used to quickly and accurately verify whether user input is correct. This article will introduce how to use regular expressions in Golang to verify whether the input is a legal base64 string. Starting with basic syntax In Golang, using regular expressions requires using the "regexp" library. This library provides "Compile" and "

How to encode and decode using Base64 functions in Java How to encode and decode using Base64 functions in Java Jun 26, 2023 pm 02:24 PM

In Java programming, it is often necessary to convert binary data into text format for transmission, and Base64 encoding is a commonly used conversion method. Base64 converts three bytes of data into four bytes of text data. The text data consists of 64 characters. It only contains printable characters, so it can be transmitted in protocols such as emails and HTTP request messages. Java provides Base64 encoding and decoding APIs, so we can easily convert data. This article will introduce how to use in Java

Base Dawgz ($DAWGZ) multichain token launched on decentralized exchanges today Base Dawgz ($DAWGZ) multichain token launched on decentralized exchanges today Sep 06, 2024 am 06:34 AM

Base's first multichain token Base Dawgz ($DAWGZ) launched on decentralized exchanges today. $DAWGZ debuted on DEX at 18:00 CET and in its first

How to use PHP to upload images in Base64 format to Qiniu Cloud Storage and generate thumbnails? How to use PHP to upload images in Base64 format to Qiniu Cloud Storage and generate thumbnails? Sep 05, 2023 am 08:48 AM

How to use PHP to upload images in Base64 format to Qiniu Cloud Storage and generate thumbnails? Introduction: With the development of the Internet, the application of images is becoming more and more widespread, and image processing has become a common requirement. Qiniu Cloud Storage provides convenient image storage and processing services. This article will introduce how to use PHP to upload images in Base64 format to Qiniu Cloud Storage and generate thumbnails. Step 1: Install the necessary dependencies Before starting, we need to ensure that PHP and Composer are installed on the system (

How to use PHP to download and decode images in Base64 format from Qiniu Cloud Storage? How to use PHP to download and decode images in Base64 format from Qiniu Cloud Storage? Sep 05, 2023 pm 03:22 PM

How to use PHP to download and decode images in Base64 format from Qiniu Cloud Storage? In modern Internet applications, the storage and processing of image resources are crucial. Qiniu Cloud Storage, as a stable cloud storage platform, provides users with rich image processing functions. This article will introduce how to use PHP to download and decode images in Base64 format from Qiniu Cloud Storage. 1. Create a Qiniu Cloud Storage account and obtain an API key. First, you need to register an account on the Qiniu Cloud Storage official website and successfully create a storage space. in successfully creating

How to use PHP to convert pictures in Qiniu cloud storage to Base64 format and export it? How to use PHP to convert pictures in Qiniu cloud storage to Base64 format and export it? Sep 05, 2023 pm 04:36 PM

How to use PHP to convert pictures in Qiniu cloud storage to Base64 format and export it? In recent years, with the popularity and widespread application of cloud storage, more and more websites and applications choose to store pictures and other files in the cloud so that they can be obtained and shared anytime and anywhere. As a leading cloud service provider, Qiniu Cloud Storage is highly respected in the industry for its stability and efficiency. This article will introduce how to use PHP to convert images in Qiniu Cloud Storage to Base64 format and export them locally. First, we need to use Qiniu Cloud Storage

How to convert image to Base64 format using PHP? How to convert image to Base64 format using PHP? Sep 05, 2023 pm 06:36 PM

How to convert image to Base64 format using PHP? In modern web applications, it is often necessary to process the loading and display of images. Normally, we introduce images by setting the src attribute in the &lt;img&gt; tag, but sometimes, we may need to embed the image as data into the web page, in which case the image can be converted to Base64 format. Base64 is an encoding method that can convert binary data into displayable characters. It is often used to embed images, audio, video and other text in web pages.

See all articles