Bug Squashing for Beginners | WebReference

Bug Squashing for Beginners

Front Page1234567

Bug Squashing for Beginners

Another bug in the browsers is their incorrect handling of the LINK and META elements. Both Netscape and Explorer ignore all but one type of document link (that specifying a stylesheet for the document, which I'll illustrate when I introduce CSS in a future tutorial), and a couple of uses of the META element. So all the wonderful functionality of these elements, that specify things such as copyright notices, navigation links and so on has to be achieved otherwise.

Today, these things are usually included in the document body. Take the page you are reading right now, for instance. At the top and bottom, there are little green arrows that link to the next and previous documents in this tutorial. At the top, the WebReference path bar links to the front page of this tutorial, the front page of HTML with Style, the Experts page and the front page of WebReference.com. At the bottom, links are included for contacting the author (me), finding the legal information that relates to the content of this page, information about when this document was created and when it was last updated, and where it can be found on the Web in case it is viewed out of context. If you look at the HTML source of this document, you'll realise that this part of the document takes up almost as much HTML as the main text itself! Yet I have to include it, since otherwise people using Navigator or Explorer would find it hard to navigate through these pages.

LINK and META are used very often, however. META is an example of an element used by programs other than browsers. Specifically, search engines use the META element to gather information about documents and make them easier to find, and their "robots" (programs that go through the Web and index pages they find in search engines) follow links specified with LINK. So it is in your best interest as an author to include these elements even if most of your readers won't know they are there.

Another bug in both browsers is that they allow block elements within heading elements (H1 through H6). If you insert a block element within a heading, which is illegal according to the specification and will cause your document to appear mangled when viewed with other browsers, Navigator and Explorer allow this and apply the formatting associated with headings (usually large, bold characters) to all of the elements inside the heading. You should avoid this at all costs. There are ways of specifying large, bold fonts. Heading elements denote headings, that is titles for sections in your document. They can be used to generate tables of contents and to easily locate a specific section. They should not be used simply to give emphasis. The same is true of the ADDRESS element, in which block elements are also allowed by Navigator and Explorer.

Another element that is in the specification but not recognized by the browsers is Q. Normally, quotation marks should be inserted automatically around Q elements. However, as I mentioned in the previous tutorial, neither browser does this. For the moment, it is a good idea to compromise and use quotation marks to delimit quotes instead, and wait for wide-spread adoption of HTML 4.0 before using Q.

That's all for this time, dear reader. I hope this tutorial cleared up the confusion on why I didn't mention some details on the use of elements we have seen so far; I believed it would have confused you more if I had mentioned them without telling you about browser bugs first. From now on, every technique I introduce that is handled incorrectly by Navigator or Explorer or both, will be accompanied by a note on this bug and ways to work around it while staying in line with the specification. At some point, we will also see how SGML tools can be used to make authoring HTML documents easier, enforcing the point that the specification is your friend.

Front Page1234567


Produced by Stephanos Piperoglou

All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/html/tutorial4/7.html
Created: July 12, 1998
Revised: July 12, 1998