HTML Dog

Skip to navigation

HTML Tag: base

Defines the base location for links on a page.

Relative links within a document (such as <a href="someplace.html"... or <img src="someimage.jpg"...) will become relative to the URI specified in the base tag.

The base tag must go inside the head element.

Required Attributes

Optional Attributes

Example


<head>
	<title>Peppers</title>
	<base href="http://www.somedomain.com/directory/" />
</head>
<body>
	<p><a href="someplace.html">This</a> will actually link to http://www.somedomain.com/directory/someplace.html.</p>
	<div><img src="someimage.jpg" alt="Some image" /></div>
	<p> The location of the above image will be actually be http://www.somedomain.com/directory/someimage.jpg.</p>
</body>