
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML - <base> Tag
Description
The HTML <base> tag is used to specify a base URI, or URL, for relative links.
For example, you can set the base URL once at the top of your page in header section, then all subsequent relative links will use that URL as a starting point.
Example
<!DOCTYPE html> <html> <head> <title>HTML base Tag</title> <base href = "https://www.tutorialspoint.com" /> </head> <body> HTML: <img src = "/images/html.gif" /> </body> </html>
This will produce the following result −
Global Attributes
This tag supports all the global attributes described in HTML Attribute Reference
Specific Attributes
The HTML <base> tag also supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
href | URL | Specifies the URL of a page or the name of the anchor that the link goes to. |
target | _blank _parent _self _top |
Where to open the target URL. _blank − the target URL will open in a new window. _self − the target URL will open in the same frame as it was clicked. _parent − the target URL will open in the parent frameset _top − the target URL will open in the full body of the window |
Event Attributes
This tag supports all the event attributes described in HTML Events Reference
Browser Support
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |