Thursday 21 March 2013

the target frame of the link


The target attribute of the A element specifies the target frame of the link.

<a href="index.html" target="_top">linked text</a>

AttributeValueExplanation
target=" "_blankthe linked page opens in the new window
_topthe linked page opens in the entire window
_selfthe linked page opens in the same frame
_parentthe linked page opens in the parent frame
frame namethe 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)
<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
Parent frameAbout the parent 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>
Output

No comments:

Post a Comment