Re: reporting formatting bugs


[ Follow Ups ] [ Post Followup ] [ Editors' Bulletin Board ]

Posted by Jonah on June 05, 2101 at 05:03:35:

In Reply to: reporting formatting bugs posted by Gary Fuhrman on June 03, 2101 at 09:02:04:

Hi. For now, while the managing editors are just warming up to their positions, all errors can be sent directly to me at . Thanks for finding this one! I've fixed it.

The issue of "p" vs. "br" is one of logical vs. physical formatting. Below I've inserted the section from "The HTML Primer." In brief, logical formatting describes a formatting element, while physical formatting defines it. The "cite" tag, for example, usually produces the same result as "i". But the former is up to the browser to define, while the latter requires italic font. Similarly, "p" tells the browser to insert a paragraph break, but the browser will interpret this different depending on whether the break follows an inline element like "img" or a not-inline element like "blockquote," and might use either one or two carriage returns. Also, different browsers will interpret these contexts differently. The "br" tag, on the other hand, requires one carriage return, so using two will always ensure one full line of white space between paragraphs.

-Jonah

Character Formatting

HTML has two types of styles for individual words or sentences: logical and physical. Logical styles tag text according to its meaning, while physical styles indicate the specific appearance of a section. For example, in the preceding sentence, the words "logical styles" was tagged as a "definition." The same effect (formatting those words in italics) could have been achieved via a different tag that tells your browser to "put these words in italics."

Logical Versus Physical Styles

If physical and logical styles produce the same result on the screen, why are there both?

In the ideal SGML universe, content is divorced from presentation. Thus SGML tags a level-one heading as a level-one heading, but does not specify that the level-one heading should be, for instance, 24-point bold Times centered. The advantage of this approach (it's similar in concept to style sheets in many word processors) is that if you decide to change level-one headings to be 20-point left-justified Helvetica, all you have to do is change the definition of the level-one heading in your Web browser. Indeed many browsers today let you define how you want the various HTML tags rendered on-screen.

Another advantage of logical tags is that they help enforce consistency in your documents. It's easier to tag something as <H1> than to remember that level-one headings are 24-point bold Times centered or whatever. For example, consider the <STRONG> tag. Most browsers render it in bold text. However, it is possible that a reader would prefer that these sections be displayed in red instead. Logical styles offer this flexibility.

Of course, if you want something to be displayed in italics (for example) and do not want a browser's setting to display it differently, use physical styles. Physical styles, therefore, offer consistency in that something you tag a certain way will always be displayed that way for readers of your document.

Try to be consistent about which type of style you use. If you tag with physical styles, do so throughout a document. If you use logical styles, stick with them within a document. Keep in mind that future releases of HTML might not support physical styles, which could mean that browsers will not display physical style coding.

Logical Styles

<I>
for a word being defined. Typically displayed in italics. (Netscape is a World Wide Web browser.)
<EM>
for emphasis. Typically displayed in italics. (Consultants cannot reset your password unless you call the help line.)
<CITE>
for titles of books, films, etc. Typically displayed in italics. (A Beginner's Guide to HTML)
<KBD>
for user keyboard entry. Typically displayed in plain fixed-width font. (Enter passwd to change your password.)
for a sequence of literal characters. Displayed in a fixed-width font. (Segmentation fault: Core dumped.)
<STRONG>
for strong emphasis. Typically displayed in bold. (NOTE: Always check your links.)
<VAR>
for a variable, where you will replace the variable with specific information. Typically displayed in italics. (rm filename deletes the file.)

Physical Styles

<B>
bold text
<I>
italic text
<TT>
typewriter text, e.g. fixed-width font.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ Editors' Bulletin Board ]