HTML Traps

There are several HTML-related traps. These include the use of frames, iframes, external DIVs, graphical text, large HTML files, and complex (or erroneous) HTML.

Using Frames

For better or for worse, HTML frames are still used on many websites today. The idea of HTML frames was to help in website navigation by separating distinct screen areas into more easily manageable units. Figure 8-5 shows a typical frame layout.

Sample frame structure

Figure 8-5. Sample frame structure

The following HTML code created the layout in Figure 8-5:

<HTML>
<head>
<title>Frame Example</title>
</head>
<noframes>
This website was designed with frames. Please use a browser that
supports frames.
</noframes>

<frameset rows="15%,70%,15%">
   <frame src=header.html">
   <frameset cols="20%,80%">
     <frame src="navigation.html">
     <frame src="mainbody.html">
   </frameset>
   <frame src="footer.html">
</frameset>
</HTML>

So, where is the problem? The biggest problem is that some search engines may not be able to crawl all of your pages. Some of these search engines might even choose to ignore anything within the <frameset> and </frameset> tags. To help the situation, you can add links to your main content between the <noframes> and </noframes> tags.

Now, let’s say the search engine can index all your pages within your framed structure. There is still a problem: search engines will more than likely return your frame fragments instead of the frameset ...

Get SEO Warrior now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.