target (HTML attribute)
| Depr. | Version |
|---|---|
| No | HTML 2 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
Description
The
target attribute in the base
element is almost certainly going to be used in the context of a
frameset, where you want 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 (which
contains the iframe) to open the destination of the
links inside that floating frame (although this is a much less likely
scenario than that outlined for
frameset).
Example
Here, the base
target is defined as a frame named
"right":
<base href="http://lloydi.com" target="right"/> ⋮ <p> 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>. </p>
Value
Refer to the value
section for target for
all the values that can be included in the target,
and their meanings and uses.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full |
It causes no compatibility issues, and has excellent support across all tested browsers.
User-contributed notes
There are no comments yet.