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

IFrames
A trick for IE and advanced Web Browsers

By , About.com Guide

In-line frames or iframes are a great way to house sidebar notes and other information that is not directly relevant to the subject, but has some interest. They allow you to nest a frame in a document in the same way that you would nest an image. The other nice thing about them is that they include an easy out for browsers that are incompatible.

Here's how they work:

  1. Write your HTML as usual, including image and text.

  2. When you get to the location where you want the iframe, include the following:
    <iframe src="framesrc.html" width=200 height=100 align=right>
    This is an in-line frame. You can <a href="framesrc.html">view the frame</a> and then hit your back arrow to return to the page.
    </iframe>
  3. Continue your page as usual.

The trick to using iframes is to treat them as images. Define the height and width, and place them in your Web page. Just don't forget the ending tag. To keep them accessible, make sure that you include text within the two tags explaining what the non-IE users are missing.

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. 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. HTML and XHTML
  5. XHTML
  6. Frames
  7. iFrames
  8. Iframes - How to use inline frames or Iframes>

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

All rights reserved.