HTML <base> tag
Example
Specify a default URL and a default target for all links on a page:
<head>
<base href="http://www.w3schools.com/images/" />
<base target="_blank" />
</head>
<body>
<img src="stickman.gif" />
<a href="http://www.w3schools.com">W3Schools</a>
</body> |
Try it yourself!
|
Definition and Usage
The <base> tag specifies a default address for links or a default
target for
linked documents.
The <base> tag goes inside the head element.
Browser Support
The <base> tag is supported in all major browsers.
Differences Between HTML and XHTML
In HTML the <base> tag has no end tag.
In XHTML the <base> tag must be properly closed.
Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute |
Value |
Description |
DTD |
href |
URL |
Specifies the URL to use as the base URL for links in the
page |
STF |
target |
_blank
_parent
_self
_top
framename |
Where to open all the links on the page. This attribute can be overridden by
using the target attribute in each link.
- _blank - all the links will open in new windows
- _self - all the links will open in the same frame they where clicked
on
- _parent - all the links will open in the parent frameset
- _top - all the links will open in the full body of the window
- framename - the name of the target frame
|
TF |
Standard Attributes and Events
NONE
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|