name
attribute to give each of your frames a special identity.target
attribute in your hyperlinks.<frame>
tags in the frameset document.name
ATTRIBUTEname
attribute is used in each <frame>
tag to allow you to give that frame a special identity. This identity will serve as a 'target name' which is used in hyperlinks that load new pages intended for that frame.name
attribute can be anything you want as long as it's unique. In the source code of our frameset document, the menu frame is simply called 'menu' and the content frame is called 'content':
<html>
<head>
<title>HTML Frames - A Basic Frame Layout</title>
</head>
<frameset cols="25%,75%">
<frame src="menu.htm" name="menu">
<frame src="chapter1.htm" name="content">
</frameset>
</html>
target
ATTRIBUTEtarget
attribute. The value of the target
attribute is the name of the frame (in this case "content") into which you wish to load the new web page. menu.htm
, the frame source document of the menu frame, illustrates the use of the target
attribute:<html>
<head>
<title>Site Menu</title>
</head>
<body>
<center><h3>War of the Worlds</h3>
<b><i>by H. G. Wells</i></b><br>
<br>
<a href="chapter1.htm" target="content">Chapter 1</a><br>
<a href="chapter2.htm" target="content">Chapter 2</a><br>
<a href="chapter3.htm" target="content">Chapter 3</a><br>
<a href="chapter4.htm" target="content">Chapter 4</a><br>
</body>
</html>
target
attribute in all your links. All you have to do is insert the base
element in between the <head>...</head>
tags of the frame source document containing the links. The target
attribute is then used in the base
element to define the default target for any hyperlink on that web page. Thus, in our basic frame layout, the source code of menu.htm
could be rewritten as follows:<html>
<head>
<title>Site Menu</title>
<base target="content">
</head>
<body>
<center><h3>War of the Worlds</h3>
<b><i>by H. G. Wells</i></b><br>
<br>
<a href="chapter1.htm">Chapter 1</a><br>
<a href="chapter2.htm">Chapter 2</a><br>
<a href="chapter3.htm">Chapter 3</a><br>
<a href="chapter4.htm">Chapter 4</a><br>
</body>
</html>
base
element, all hyperlinks in framed pages should contain the target
attribute. This is especially important when creating hyperlinks to web pages that are not on your web site, a.k.a., external links. If you neglect to specify a target in the hyperlink code, the new page will —by default— load into the frame that the hyperlink is located in. This will result in someone else's content displayed in your frame giving the appearance that their content is part of your website. To avoid this —and any legal hassles that may arise as a result of this— you'll need to understand how...target="_top"
attribute/value pair is used to create a hyperlink that —when activated— loads a new page which breaks out of all framesets. The new page is thus loaded into the original full browser window. <a href="http://example.com/" target="_top">Example.com</a>
target
attribute in your hyperlink code to perform their respective functions. Note that they are all preceded by the underscore ( _ ) character.<a href="web address" target="frame target name">link text</a>
Frame target name | What it does |
_top | Loads the new page into the full original browser window (see above). |
_blank | Loads the new page into a completely new browser window. (You would thus have two browser windows open: one containing the original framed page and the other containing the new page.) |
_self | Loads the new page into the same frame in which the hyperlink exists in. (If you don't specify a target in your hyperlink then this is what happens by default.) |
_parent | Loads the new page into the immediate frameset parent of the frame in which the hyperlink exists in. (Useful in advanced frame layouts.) |
Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates
See also:
If you need a .COM web address, you can get one quick and easy at...
<~ BACK | TOP | NEXT ~> |