HTML <base> hrefAttribute

HTML base 标签参考手册HTML <base> Tag

Examples

Specifies the base URL for all relative URLs on the page:

<head>
<base href="../images/index.html">
</head>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the href attribute.


Definition and Usage

The href attribute specifies the base URL for all relative links on the page.


Syntax

<base href="URL.html">

Attribute Values

Value Description
URL An absolute URL that serves as the base URL (for example, "http://www.w3cschool.cc/").


HTML base 标签参考手册HTML <base> Tag

Other extensions