Skip to: content, navigation

by Ian Lloyd

target (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full
Spec
Depr. Version
Yes HTML 2
target="
{ _blank | frame name | _parent | _self | _top }
"

Example

The base target is defined here as a named window "right":

<base href="http://lloydi.com" target="right" />
…
I've published my <a href="/travel-writing/">holiday diaries</a>,
including the <a href="/travel-writing/prague/2006/day2.html">crazy
bone church at Kutna Hora</a>

Description

The target attribute in the base element is almost certainly going to be used in the context of a frameset, where you wish all links from a document in one frame to open in another named frame; you might also use it in the context of an iframe, where you wish all links from the ‘host’ document (that contains the iframe) to open the destination of the links inside that floating frame (although this is a much less likely scenario than the frameset one).

Value

Refer to the value section for the a element for all the possible values in the target, and their meaning/use.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

Causes no compatibility issues. It has excellent support across all tested browsers.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters