Basics
Creating a Document
Head and Body Elements
Formatting Text
Creating Lists
Embedding Images
URLs Explained
Linking to Documents
Creating Tables
Forms Form Basics
Input and Textarea
Select Lists
Frames Framesets
The Frame Element
Nested Framesets
Targetting Frames
Inline Frames
Tips and Tricks Meta Tags
Transition Effects
HTML Generators Create a Document
Create a List
Create a Table
HTML
Basics
Implementing CSS
CSS Syntax
Pseudo Classes/Elements
CSS Classes
CSS Properties Font Properties
Color and Background
Text Properties
Border Properties
Margins and Padding
Size and Position
Tips and Tricks Menu Buttons
Special Effects
CSS
Basics
Running a Script
Variables
Expressions and Operators
Objects.Properties.Methods
The Date Object
Strings
Regular Expressions
Defining RegExp Patterns
Branches and Conditions
Loops
Arrays Array Basics
Array Methods
Sorting Arrays

User-Defined Functions
Cookies
Windows
Frames
Tips and Tricks Image Replacement
Using Includes
Form Validation
Debugging
JavaScript
Basics
Creating a Script
Running a Script
Variables
Expressions and Operators
Strings Strings Basics
Strings and Substrings
Replacing Substrings
Regular Expressions
Branches and Conditions
Loops
Arrays Array Basics
Array Functions
Sorting Arrays
User-Defined Functions
Include and Require
Uploading Files
File Functions
Session Variables
Tips and Tricks Page Templates
Form Reply Scripts
Form Validation
JavaScript to PHP
PHP
Basics
Create and Drop
Show and Describe
Insert, Update and Delete
Querying
Join Queries
Functions
Table Locking
PHP/MySQL Functions Accessing a Database
Querying with PHP
Create and Drop with PHP
Insert and Update with PHP
Frequently Used Functions MySQL
Basics
Layout and Navigation
Page Content Style
Web Page Copy
Graphics and Animation
HTML Forms
Accessibility
Legal Requirements
MySQL
HTMLBasicsCreating a DocumentHead and Body ElementsFormatting TextCreating ListsEmbedding ImagesURLs ExplainedLinking to DocumentsCreating TablesForms - BasicsInput and TextareaSelect ListsFramesetsThe Frame ElementNested FramesetsHTML Frames - Targeting FramesTargetting FramesInline Frames

Home > HTML > Frames - Targeting Framesprinter version

HTML Frames - Targeting Frames

When a link is clicked within an HTML frame to load another document, then by default the document will load into the same frame as the link.

To load a document into a frame, other than the frame containing the link, requires the target attribute to be used within the <a> element in conjunction with the name attribute within the <frame> element.

The name attribute works in the same way with frames as it does with windows since frames are actually treated as windows within HTML.

If we take a 2 column frameset where the left frame contains a link to load a document into the right frame then the frameset will look like that below.

A Two Column Frameset Example
<frameset cols="25%,75%">
    <frame src="left_column.htm">
    <frame src="opening_page.htm" name="right_column">
</frameset>



If we wish a document called "page_2.htm" to load into the right hand frame from a link within the left hand frame then the link within "left_column.htm" will take the form below.

<a href="page_2.htm" target="right_column">Load Page 2</a>


The target attribute can also be used with the <form> element to send the contents of the form to a script then output the results to another frame as shown below.

A Form Targeting Another Frame
<form action="myform.php" method="post" target="right_column">
    <!-- Form Elements -->
    <input type="submit" name="Send">
</form>


If it's required that all returned pages be loaded into a particular frame then the <base> can be used within the <head> element thus.

Using the Base Element for Targeting
<head>
    <base target="right_column">
</head>


Target Values

The <target> attribute can take on a number of special values.



Care must be taken when linking to external websites since in most cases it's undesirable to have a page from an external website displayed inside one of your frames.

To avoid this, within all links to external websites, use the target="_blank" attribute, to load the document into a new window, or the target="_top" attribute, to load the document into the existing browser window.

Previous - Frames nested framesets Previous - Nested Framesets     Next - Frames - Inline Frames Next - Frames inline frames


Privacy | Terms | Contact | Links | Sitemap | RSS Feeds RSS and JavaScript Feeds
©2010 www.webdesignworkmate.co.uk all rights reserved 
Design and Production by smallbizonline website design © 2000-2010
Valid HTML 4.01! Level Double-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0Valid CSS!
Tips and TricksMeta TagsTransition EffectsHTML GeneratorsCreate a DocumentCreate a ListCreate a Table
Got any HTML Tips?
Send me your tip and if it's suitable I'll put it on the site, credit it to you and add a link back to your site.
Recommended Reading
html_and_xhtml

html and xhtml complete reference

learning web design beginners 

guide