1. Home
  2. Computing & Technology
  3. Web Design / HTML

Advanced Frames Tricks
The Base Tag and the Inline Frame

By , About.com Guide

The base Default Target

This is an easy way to specify the default target for all of your links on a page. Instead of naming the target in every link, you simply put the base tag in the <head> portion of your document:
<html>
<head>
<title>Title</title>
<base target="contents">
</head>

All links in the above document would automatically load in the contents frame, unless I specifically name a different target.

The Inline Frame

Advanced browsers let you define a frame from within the middle of a conventional document, just like you might define an image or multi-media element.

The iframe tag is not used within a frameset, but within a document anywhere you might use the img tag. The primary difference is that it requires an ending /iframe tag.

When you use an iframe tag, it's best to put explanatory information in the contents of the tag for other browsers. Inline frames compliant browsers will ignore these comments, while other browsers ignore the iframe tag and display the contents.

Here is an example of the HTML for an inline frame:
...preceding content
<iframe src="body.html" width=200 height=100 align=right>
You are not using Internet Explorer or an IFrames compliant browser. To view this <a
href="body.html">in-line frame</a> correctly, you'll need
an iframe compliant browser.
</iframe>
...following content

You can see this page at bl_inline.htm. Be sure to use Internet Explorer or Mozilla or another inline frames compliant browser.

Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. Web Design Articles A-H
  6. Web Design/HTML Articles C
  7. Named Frames, the Target Attribute, and Iframes>

©2009 About.com, a part of The New York Times Company.

All rights reserved.