We need to look at some major open questions related to HTML/ XHTML. You will encounter these issues over and over again throughout the book and while they are pretty easy to describe, they are very hard to answer.
Logical and Physical HTML
No introduction to HTML would be complete without a discussion of the logical versus physical markup battle at the heart of HTML. physical HTML, refers to using HTML to make pages a look particular way; logical HTML refers to using HTML to specify the structure of a document while using another technology, such as Cascading Style Sheet (CSS) to designate the look of the page.
Most people are already very familiar with physical document design because they normally use WYSIWYG (what you see is what you get) text editors, such as Microsoft Word. When Word users want to make something bold, they simply select the appropriate button, within the and tags, as shown here;
this is important.
This can lead people to believe that HTML is nothing more thank simple formatting language. WYSIWYG HTML editors (such as Microsoft FrontPage) also reinforce this view. But as page designers try to use HTML in this simplistic fashion, they sooner or later must face the fact that HTML is not a physical page-description language. Page authors can’t seem to make the pages look exactly the way they want, and even when they can, doing so often requires heavy use of table with <> tags, giant images or Flash files, and even trick HTML. Other technologies, such as style sheets, might provide a better solution for formatting text than a slew of inconsistently supported tricks and proprietary HTML elements.
Accordingly to most markup experts, HTML really was not designed to provide most of the document layout features people have come to expect, and shouldn’t be used for that purpose. Instead, HTML should be used as a logical, or generalized, markup language that defines a document’s structure, not it’s appearance. For example, instead of defining the introduction of a document with particular margin, font, size, HTML just labels it as an introduction section and lets another system, such as Cascading Style Sheets, determine the appropriate presentation. In the case of HTML the browser or a style sheet has the final say on how a document looks.
Even traditional HTML contains mostly logical elements. An example of a logical element is strong with <> on the sides, which indicates something of importance as shown here;
this is important.
The Strong element says nothing about how the phase “This is important” will actually appear, although it probably will be rendered in bold. Although many of HTML’s logical elements are relatively underutilized, others, such as headings like h1 and paragraphs
, are used regularly although they are generally thought of as physical tags by most HTML users. Consider that people generally consider the h2 a large heading, h2 with <> a smaller heading, and that
tag cause returns and you can see that logical or not, the language is physical to most users.
The benefits of logical elements might not be obvious to those comfortable with physical markup. To understand the benefits, its important to realize that on the Web, many browsers render things differently. In addition, predicting what the viewing environment will be is difficult. What browser does the user have? What is his or her monitor’s screen resolution? Does the user even have a screen? Considering the extreme of the user having no screen at all; how would a speaking browser render the
Many realistic examples exist of the power of logical elements. Consider the multilingual aspects of the Web. In some countries, the date is written with the day first, followed by the month and year. A
Whether you subscribe to the physical (specific) or the logical (general) viewpoint, traditional HTML is not purely a physical or logical language yet. In other words, currently used HTML elements come in both flavors-physical and logical- and developers nearly always think of them as physical. Elements that specify fonts, type size, type and so on are physical Tags that specify content or importance, such as and using <> with h1 in the middle, and let the browser decide how to do things logical. A quick look at the Web pages across the internet suggests that logical elements and style sheets often go unused because while the Web developers want more layout control than raw HTML provides, style sheets are still not well understood by many developers, and browser support continues to be to buggy for some people’s taste. Finally, many designers just don’t think in the manner required for logical markup and their WYSIWYG page editors generally don’t encourage such thinking ! Of course, the strict forms of XHTML, particularly XHTML2, will change all this, returning the language to a primarily logical formatting language.
Standards versus Practice
Just because a standard is defined doesn’t necessarily mean that will be embraced. Many Web developers simply do not know or care about them. As long as their page looks right in their favorite browser, they are happy and they will continue to go on abusing HTML tags such as using (<)on the ends of table.. and using various tricks and proprietary elements. In some sense, HTML is the English language of the Web, poorly spoken by many but widely understood. Yet this does not mean you should embrace every proprietary HTML tag or trick used. Instead, acknowledge what the rules are, follow them as closely as possible, and break them only on purpose and only when absolutely necessary. Be care not to follow the standards or markup validator too religiously in the name of how things ought to be done; your users and clients certainly will not forgive browser errors or page display problems because you followed the rules and the browser vendor did not ! With the rise of standards-oriented browsers and the continued refinement of the HTML, XHTML and CSS specifications, things will improve, but the uptake is still slow, and millions of documents will continue to be authored with no concept of standards-complaint logical structuring. However, this does not mean that XHTML should be avoided. On the contrary, the structure and rigor it provides allows for easier maintenance, faster browsers, the possibilities of even higher quality Web tools, and ability to automatically exchange information between sites. Even with these incredible possible benefits, given the short-term similarity of XHTML and HTML, some developers still think; Why bother? Web page development continues to provide an interesting study of the difference between what theorists say and what people want and do.
My other blog;
1. Across this bridge
4. When life become a book
5. Read Between the Lines
6. The Sleeping Turtle Art Gallery
Subscribe in "Struggling Parents