If physical and logical style tags 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 logical style 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 using what are called cascading style sheets, or
CSS.
Another advantage of logical style 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. (This is possible using a local cascading style
sheet on the reader's own computer.) 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, you should 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 tags 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 certain logical styles, which could mean that
browsers will not display your logical-style coding. (For
example, the <DFN> tag -- short for
"definition", and typically displayed in italics
-- is not widely supported and will be ignored if the
reader's browser does not understand it.)
The main difference between logical and physical style
tags is what they say. Logical styles say something
about the meaning of the Author's text. Physical
styles say how the Author wants to display the text. |