English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
<base> tag specifies the base URL for all relative URLs in the document /A document can contain at most one <base> element, and this element must be within the <head> element.
Specify the default URL and default target for all links on the page:
<!DOCTYPE html> <html> <head> <title>HTML:<base> href attribute - 基础教程网 oldtoolbag.com</title> <base href="https://www.oldtoolbag.com/" target="_blank"> </head> <body> <p>Please note that we only specify relative addresses for images. Since we have specified the base URL in the header, the browser will use "https://www.oldtoolbag.com/static/images/locating the image</p> <img src="static/images/colormap.gif" width="234" height="199" alt="colormap"> <a href="tags/tag-base.html">HTML base Tag</a> </body> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the href attribute.
The <base> tag specifies the base URL for all relative URLs in the document /Target.
A document can contain at most one <base> element, and it must be within the <head> element.
Note: If the <base> tag is present, it must have the href attribute or the target attribute, or both.
None.
In HTML, the <base> tag has no closing tag.
In XHTML, the <base> tag must be properly closed.
None. The <base> tag does not support any event attributes.
<base href="URL">
Value | Description |
---|---|
URL | as an absolute URL for the base URL (e.g. "https://www.oldtoolbag.com/)。 |