View video tutorial
HTML Base
HTML
The HTML <base> tag specifies a base URL or target for all relative URLs within an HTML document.
Base URL
<base> tag set the base URL for all the relative urls in the page.
A document can have only one <base> tag.
<base> must specify href or target or both.
It must be placed within the <head> section of the document.
Learning with HTML Editor "Try it Now"
You can edit the HTML code and view the result using online editor.
Example
<!DOCTYPE html>
<html>
<!-- Example: Base Tag -->
<head>
<title>Page Title</title>
<base href="/html/">
</head>
<body>
<h1>Base tag example.</h1>
<p>The base tag set the base URL for all the relative urls in the page.</p>
<p>A document can have only one base tag.</p>
</body>
</html>
Click on the "Try it Now" button to see how it works.