Versión en español

HTML base tag

Note: If you don't know what a tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.

 

Description

The HTML base tag sets the base URI that will be used to resolve relative URIs in all the document. By using the "target" attribute you can also define a default target for all the links in the document.

Supose that this code is in a document located in http://www.htmlquick.com/. As we are going to show a number of images that resides in the "images" folder, we may use the HTML base tag as following:

Code begin <html>
<head>
<base href="http://www.htmlquick.com/images/" target="_blank">
</head>
<body>
<img src="1.gif" />
<img src="2.gif" />
<img src="3.gif" />
</body>
</html>Code end
 


Attributes

href (uri)

Specifies an absolute URI as a base to resolve all the relative URIs in the document. Must be defined in the head section.
 

target (frame-target)

Specifies the name of the frame where the destination document should be loaded. Refer to the frame-target type definition for further information.

Code begin Open in a new window: <a href="http://www.w3c.org" target="_blank">WWW Consortium</a>
Open in a frame named "content" (frame must be present in the actual frameset): <a href="http://www.w3c.org" target="content">WWW Consortium</a>Code end
 
 


Events

There are no events defined for this tag.

See complete list and information about events in HTML


Bypass footer options Send to a friend Send to a friend