Physical vs. Logical Markup
There are two basic types of HTML tags, logical tags represent the structure and meaning of a document, with only suggested renderings for their appearance which may or may not be followed by various browsers under various system configurations. The physical tags represent specific visual effects which are intended to be reproduced in a precise manner, and carry noconnotation as to their semantic meaning.
The original implementation of HTML contained almost entirely logical tags, in accordance with the HTML philosophy that it was a structural language rather than a screen-layout description. A few physical tags slipped in even back then (such as <B> for boldfaced text). As HTML was augmented by browser-makers Netscape and Microsoft, a large number ofphysical tags were added, with very little augmentation of the logical tag set. The HTML 4.0 standard attempts to remedy this balance by introducing some new logical tags and declaring some of the physical tags and attributes as "deprecated" in favor of stylesheets.
HTML style advisors have given varied and conflicting advice about whether to prefer the use of logical or physical tags. Hard-linepurists may say to use only logical tags at all times, while some graphical designers advocate using only physical tags (because the logical ones have the tendency, distressing to those of a visual mindset, to be rendered in widely varying ways). I don't follow either rigid standard; rather, I support using whichever tags make sense for the particular application.
When to Use Logical MarkupTry to use the logical constructs whenever they fit the meaning you're trying to convey. When you want a header at the top of a page, the <H1> tag is a good choice. The alternative of using a physical <FONT SIZE="+3"> tag has the negative effect of not logically connoting a header; any program that attempts to create a structural outline of your document from its headers will befrustrated when you don't mark them as such. A text-mode browser like Lynx, and a reader program for the blind, may have a manner of its own to signal a header to the user, and this will be inoperative on your document when you signal that with a font change that's meaningless on these other devices.
There are a number of logical tags that have specific meanings that may be useful to you. <CITE>is used to surround the title of a work being cited (usually rendered in italics). <EM> designates emphasized text, and <STRONG> designates strong emphasis, usually rendered in italics and bold respectively. The advantage of using the logical rather than the physical tags in these cases is that your meaning is more precisely conveyed. The fact that the mass-market browsers don'tactually do anything with these distinctions at the moment is no reason to let them slide; other software can still take advantage of them when indexing or abstracting your documents. Not to mention stylesheets: A site full of hard-coded physical markup will be much harder to convert to stylesheet use than a site with a clean, simple logical structure.
If you get out of the graphical-artist mentalitythat demands pixel-perfect control of your site's rendering, you'll be able to convey your site's meaning in a sensible, platform-independent way. Try not to defeat the logic of HTML by avoiding the logical tags just because you don't like what some of them look like on some browsers. For instance, some designers don't like how paragraphs are rendered, so they use a line-break followed by an emptygraphic to indent the next line. This sort of thing is not generally a good idea, as it's likely to degrade poorly under different environments (e.g., text-only browsing) and obscure the structure of your document for indexing robots. Learn how to use stylesheets, and you can define the look of the logical elements of your pages in a much more flexible way than you ever could with physical...
Leer documento completo
Regístrate para leer el documento completo.