Definition and usage
The <base> tab specifies 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 whitespace in the relative url.
Using <base> tags can change this. 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>, , <link>, <form> tags.
The <base> tag must be inside the head Element.
Optional properties
Properties |
value |
Description |
Target |
- _blank
- _parent
- _self
- _top
- FrameName
|
Where to open all the links in the Page. |
Case:
Basehref="http://www.w3school.com.cn/i/"/><Basetarget="_blank"/>"Eg_smile.gif"/><br/><p> Please note that we have specified a relative address for the Image. Since we have set a benchmark URL in the head section, the browser will look for a picture at the following address:</p><p>"Http://www.w3school.com.cn/i/eg_smile.gif"</p><br/><br/><p><a href="http://www.w3school.com.cn">W3School</a></p><p> Note that the link opens in a new window, even if there is no target= in the link"_blank"Property. This is becauseBaseThe target property of the element has been set to"_blank"The </p></body><! DOCTYPE Html>"Content-type"Content="text/html; charset=gb2312"/><meta http-equiv="Content-language"Content="ZH-CN"/><Basetarget="_blank"/>"http://www.w3school.com.cn"target="_blank"> This connection </a> will be loaded in a new window because the target property is set to"_blank". </p><p><a href="http://www.w3school.com.cn"> This connection </a>will also be loaded in a new window, even without the target Property. </p></body>Base ObjectThe base object represents the base element of the HTML.
The base object is created in the HTML document <base> every time it appears.
Base Object Properties
Properties |
Description |
Href |
Sets or returns the base URL for all links in the Page. |
Id |
Sets or returns the ID of the <base> element. |
Target |
Sets or returns the default target frame for all links in the Page. |
HTML <base> Tags Specify default address or default destination for all links on the page