W3Schools.com

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 a 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
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE