The target attribute of the A element specifies the target frame of the link.
<a href="index.html" target="_top">linked text</a>
Attribute | Value | Explanation |
---|---|---|
target=" " | _blank | the linked page opens in the new window |
_top | the linked page opens in the entire window | |
_self | the linked page opens in the same frame | |
_parent | the linked page opens in the parent frame | |
frame name | the linked page opens in the named frame |
Tips and Notes
The target attribute cannot be used with the Strict DTD.
Example
target="_top" (The linked page opens in the entire window)
target="_self" (The linked page opens in the same frame)
target="_parent" (The linked page opens in the parent frame)
target="FrameName" (The linked page opens in the named frame)
<p><a href="example_t01.html" target="_top">Entire window</a></p>
Output
target="_self" (The linked page opens in the same frame)
<p><a href="example_t02.html" target="_self">Same frame</a></p>
Output
target="_parent" (The linked page opens in the parent frame)
<p><a href="example_t03.html" target="_parent">Parent frame</a></p>
Output
About the parent frame
When you load the "child.html" into the B frame, the parent frame of the C frame becomes the B frame.
When you load the "child.html" into the B frame, the parent frame of the C frame becomes the B frame.
target="FrameName" (The linked page opens in the named frame)
<ul> <li><a href="example_t04.html" target="top">B frame</a></li> <li><a href="example_t04.html" target="main">C frame</a></li> </ul>
No comments:
Post a Comment