X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML <base> href Attribute

HTML base Tag Reference HTML <base> tag

Example

Specify a base URL for all relative URLs on a page:

<head>
<base href="http://www.w3schools.com/images/">
</head>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The href attribute is supported in all major browsers.


Definition and Usage

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


Syntax

<base href="URL">

Attribute Values

Value Description
URL An absolute URL that acts as the base URL (like "http://www.example.com/")


HTML base Tag Reference HTML <base> tag

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook