The <base> label sets the default address or default destination for all links on the page.
Typically, the browser extracts the corresponding element from the URL of the current document to fill in the blanks in the relative URL.
Using <base> labels can change that. The browser will then no longer use the URL of the current document and use the specified base URL to resolve all relative URLs. This includes URLs in the <a>, <img>, <link>, <form> tags.
When inserting an image on a page in the previous example, we must specify a relative address, and the browser will look for the full URL used by the file:
<img src= "Pic.gif"/>
Example 2
Specify the default URL and default target for all links on the page:
Tip: Place the <base> tab in the first element of the head element so that other elements in the head can be used
The information in the <base> element.
Note: In a document, you can use up to one <base> element.
Property
The
property value describes the URL that the href URL requires to be used as a base URL in the page. Target _blank _parent _self _top where to open the links on the page. This property is overwritten by the target attribute in each link.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.