Using Frames Effectively


Although frames have some usability problems, there are some obvious advantages for using them. Just make sure that you use them the right way. Here are some tips to help.

  • Frames are not a toy Frames work best when used as a navigation tool, or when it makes sense to show two or more elements of a document at the same time.

  • Remember the target attribute Nothing is worse than clicking a hyperlink in a framed document and breaking out of frames unintentionally. Worse, each hyperlink in a framed document that does not include the target attribute has the potential of opening in a new browser window. You could end up with a real mess.

  • Include the <noframes> tag Always remember that there are people who can't see frames (either because of older browsers, or because they set their browser preferences to ignore them). Provide alternate content with the <noframes> tag.

  • Include alternate navigation within the main frame With the Web, there is no guarantee that your visitors will always arrive at your home page and see the frameset as you intended them to see it. Sometimes, they will arrive on an individual frame. If you provide additional navigation links within those pages, your visitors will still be able to move within your site.

  • Never frame other framed pages Not as frequent anymore on the Web, but when frames first became available, Web page authors framed everything, including other framesets. This compound-framing is very confusing to users.

Table 10.1 lists the HTML tags that were discussed in this lesson.

Table 10.1. HTML Tags Used in This Lesson

HTML Tag

Closing

Description of Use

<a href>

</a>

Creates hyperlinks to other documents. Always use the target attribute with frames.

<frameset>

</frameset>

Replaces the <body> tag in a frameset document and surrounds the <frame> and <noframes> tags. This tag must include the attribute to describe the orientation of the frames and their size.

<frame />

 

Includes the frame's name and id and a URL for the content (src). It also might include attributes to define the border and scrolling.

<iframe>

</iframe>

Embeds a frame inside another document. It only works with Internet Explorer.

<noframes>

</noframes>

Defines an alternate viewing page for browsers that don't support frames.


In this lesson, you've learned:

  • A frameset document defines the number of frames and their sizes; standard HTML documents will be contained in the frames.

  • Each frame of a frameset document must be named so that you can direct your hyperlink to appear in a specific target frame.

  • Despite their obvious advantage for organizing your site's navigation elements, many people dislike frames because of usability problems associated with them.



Sams Teach Yourself HTML in 10 Minutes
Sams Teach Yourself HTML in 10 Minutes (4th Edition)
ISBN: 067232878X
EAN: 2147483647
Year: 2004
Pages: 151
Authors: Deidre Hayes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net