Home  >  Article  >  Web Front-end  >  What is the role of the html base tag? Analysis of the role of the base tag (with examples)

What is the role of the html base tag? Analysis of the role of the base tag (with examples)

寻∝梦
寻∝梦Original
2018-09-05 13:59:126886browse

This article mainly introduces the usage of HTML base tag, as well as the analysis of the role of HTML base tag. Next, let us read this article together

First we analyze the role of the html base tag:

The base tag is the base URL tag in the HTML language. It is a single tag located in the head tag of the web page header file. Within, a page can only use at most one base element, which is used to provide a specified default target, which can also be regarded as a mark that expresses the path and connection URL.

Common URL path forms include relative paths and absolute paths respectively. If the base tag specifies a target, the browser will use this target to parse all relative paths in the current document, including tags (a, img , link, form), that is to say, the browser will add the target given by base before the path when parsing, and the relative paths in the page will also be converted into absolute paths. When using the base tag, you should bring the href attribute and target attribute.

Let’s talk about the base href attribute:

For example, if a URL address is specified by base, then you don’t need to fill in the complete address for the file or image you want to call. , just write the file name or picture name. Use the picture below to briefly understand the usage of the base tag. Link to the HTML video tutorial on the PHP Chinese website. The full address is http://www.php.cn/course/list/11.html

<head>
<base href="http://www.php.cn/course/list/11.html/ target="_blank" />
</head>
<body>
<a href="html视频教程">PHP中文网</a>
</body>
## The #base tag specifies the PHP Chinese website html video tutorial as the base URL. Then all hyperlinks in the current document will follow this rule. We set the relative access target in the link, and the browser will automatically parse a complete Access the link address. If the target of the link a is empty, the browser will also access it based on the url given by base. It is worth noting that the base tag needs to be placed in front of the statement containing the url address.

Let’s talk about the base target attribute:

The target attribute is the way to open the web page window. If you set this attribute in the base tag, then all the links in the page will be Following this method to open a web page, you have the following options:

  • _blank: Open the linked page in a new window.

  • _parent: Open the link in the previous window.

  • _self: Open the link in the current window. This is the default value and can be omitted.

  • _top: Open the link in the entire browser window, ignoring any frames.

html Analysis of the role of base tag:

This is the basic HTML language. Use 0f84fb2d9fdff4eb1678134d8196957d to set the target window of all links on this web page. In other words, as long as the sentence 0f84fb2d9fdff4eb1678134d8196957d is added to the web page, then all hyperlinks do not need to be set separately. It is best to write this sentence between 93f0f5c25f18dab9d176bd4f6de5d30e and 9c3bca370b5104690d9ef395f2c5f8d1. For example, fcd54ff396408747cc063f946072cf72 means that the target addresses of all hyperlinks in the web page are opened in a new window.

The meaning of the HTML base tag in JSP: ## The #base tag is a base link tag and is a single tag. Used to change the parameter default value for all link tags in the document. It can only be applied between the tags 93f0f5c25f18dab9d176bd4f6de5d30e and 9c3bca370b5104690d9ef395f2c5f8d1.

All relative paths on your web page will be preceded by the address pointed to by the base link when linking.

jsp page can be defined: 19ca1cd62c1c4c4a6375594882b07ea5

Add ffc28ac0de32d0d9b350ce62c6f18458" > after the head tag.

The above is an introduction to the role of the HTML base tag (if you want to learn more HTML knowledge, come to the PHP Chinese website

HTML video tutorial

). If you have any questions, you can leave a message below. . Here is also an introduction to the use of the html base tag: How to use the html base tag? Summary of usage of html base tag[Editor’s recommendation]

How to set up the html search box? Examples of how to use the input tag in the html search box


What are the attributes of the html input tag? Summary of usage of input tag (with examples)

The above is the detailed content of What is the role of the html base tag? Analysis of the role of the base tag (with examples). For more information, please follow other related articles on the PHP Chinese website!

Statement:
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