HTML and CSS Reference
In-Depth Information
11.7. Named Frame or Window Targets
As we discussed earlier in section 11.4.1 , you can label a frame by adding
the name attribute to its <frame> tag. [2] Once named, the frame may be-
come the destination display window for a hyperlinked document selec-
ted within a document displayed in some other frame. You accomplish
this redirection by adding the special target attribute to the anchor that
references the document.
[2] The id attribute provides the same unique labeling but you cannot use it for frame content redirec-
tion. Instead, the browser ignores the id-named target frame and displays the linked document in a new
window.
11.7.1. The target Attribute for the <a> Tag
If you include a target attribute within an <a> tag, the browser loads and
displays the document named in the tag's href attribute in a frame or
window whose name matches the target. If the named frame or window
doesn't exist, the browser opens a new window, gives it the specified la-
bel, and loads the new document into that window. Once this process has
been completed, linked documents can target the new window.
Targeted hyperlinks make it easy to create effective navigational tools.
A simple table of contents document, for example, might redirect docu-
ments into a separate window:
<h3>Table of Contents</h3>
<ul>
<li><a href="pref.html" target="view_window">Preface</a>
<li><a href="chap1.html" target="view_window"> Chapter 1 </a>
<li><a href="chap2.html" target="view_window"> Chapter 2 </a>
<li><a href="chap3.html" target="view_window"> Chapter 3 </a>
</ul>
 
 
Search WWH ::




Custom Search