HTML and CSS Reference
In-Depth Information
Task: Exercise 17.6: Linking Documents to Individual Frames
After you've named the frames, you have to fix the links in the choice.html page so that
they load the target pages in the main frame rather than the left frame.
You might recall that the target attribute was used with the <a> tag to force a document
to load into a specific window. You'll use the same attribute to control into which frame
a document is loaded.
In this exercise, you want to load a page in the main (bottom-right) frame whenever you
click a hyperlink in the left frame. Because you've already named the bottom-right
frame “main” , all you need to do is add target=“main” to each tag in the choice.html
document. The following snippet of HTML source code demonstrates how to make this
<p><a href=“reason1.html” target=“main”> Reason 1 </a></p>
<p><a href=“reason2.html” target=“main”> Reason 2 </a></p>
<p><a href=“reason3.html” target=“main”> Reason 3 </a></p>
<p><a href=“reason4.html” target=“main”> Reason 4 </a></p>
<p><a href=“reason5.html” target=“main”> Reason 5 </a></p>
<p><a href=“reason6.html” target=“main”> Reason 6 </a></p>
Alternatively, you could use the <base target=“ value ”> tag because every tag in the
choice.html document points to the same frame. In that case, you wouldn't need to
include target=“main” inside each <a> tag. Instead, place the following inside the
<head>...</head> block of the document:
<base target=“main”>
With all the changes and new documents created, you should now load frameset.html
into your frames-compatible browser and view all your HTML reference documents by
selecting from the choices in the left frame.
After you get all your links working properly, you might need to go
back and adjust the size of the rows and columns as defined in
the <frameset> tags to get the layout exactly right. Remember,
the final appearance of a frameset is still determined by the size
of the screen and the visitor's operating system.
Search WWH ::

Custom Search