Home > Web Front-end > HTML Tutorial > How to use base tag

How to use base tag

php中世界最好的语言
Release: 2018-02-10 10:06:25
Original
3385 people have browsed it

This time I will show you how to use the base tag, what are the precautions when using the base tag, the following is a practical case, let's take a look. The

tag specifies the default address or default target for all links on the page.
Normally, the browser will extract the corresponding elements from the URL of the current document to fill in the gaps in the relative URL.
Use the tag to change this. 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 , , , <form> tags.

Test:

1: The link path placed in front of the base tag can use a relative path and is relative to the current path,
but the link placed after it will use a relative path. The path specified relative to 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 defined later.
Summary: base actually defines a default address and default target. The subsequent link elements will all work

I believe you have mastered the method after reading these cases. For more exciting information, please pay attention to the php Chinese website Other related articles!

Related reading:

How to use image to submit form

How to use anchor points in html web pages

What are the ways to hide HtmL elements

What is the difference between div and span

The above is the detailed content of How to use base tag. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template