Relationship

XHTML- Kicking and screaming into the future

XHTML, the standard, was first released in the year 2000. About five years later, we started to see major websites overhauled to use this standard. Even the favorite scapegoat for standards compliance punishment, Microsoft, renders its main home pages, msn.com and microsoft.com in XHTML. Standards compliant XHTML sites are still in the minority. The reason is simple. When the W3C released the new standard, the rest of the web running on HTML didn’t stop working. The rest of the web, written in various flavors of HTML, won’t be going down any time soon either. Without any compelling need to conform to the new standard, designers continue to use old, familiar methods. These methods will work in any modern browser, so why bother changing?

These feelings are similar to what I experienced. It sets up a kind of “if it ain’t broke, don’t fix it” mentality. Whether HTML was “broken” or not is a different argument. For the casual Internet user, their standards are pretty straightforward. If a site displays without noticeable errors and functions to your satisfaction, these standards are met. Whatever additional steps the browser took to make such a display possible are irrelevant to most users. This kind of mindset is hard to beat in designers used to their old ways.

The technical hurdles for XHTML adoption can also be quite high, especially for large, existing websites with complex scripts. However, the time may eventually come when the “tried and true” HTML of yesterday is little more than an ancient language, incapable of being interpreted by modern electronic devices. Whether you agree with the direction the W3C is taking in HTML development is irrelevant, you’re just ready for the ride. With some perseverance, it is possible to master XHTML. In form, it is not as different from HTML as Japanese is from English. Knowing HTML gives you a basic knowledge of the language, it just becomes a matter of learning a particular dialect. Even an original naysayer like myself managed to do it.

XHTML Benefits

There are 2 main benefits to using XHTML. First is the strict nature of valid XHTML documents. “Valid” documents do not contain errors. A browser can more easily parse documents without errors. While the time saved is certainly negligible from the human user’s point of view, there is greater efficiency in browser performance. Most modern browsers will work fine in what is generally known as “quirks” mode, where, in the absence of any information on the page about the type of HTML they are reading, they present a “best guess” representation of a page. The quirks mode will also forgive many errors in the HTML. Modern browsers installed on your home computer have the luxury of size and power to deal with these errors. When browser technology makes the leap to other devices, it may not have the size and power to be as forgiving. This is where the strict and valid documents required by the XHTML standard become important.

The second benefit is in the code itself, which is cleaner and more compact than the common “table” based layout in HTML. Although XHTML retains table functionality, the standard makes it clear that tables should not be used for page layout or anything other than displaying data in a tabular format. This is generally the main obstacle that most designers have in moving to XHTML. The way many designers rely on the layout and organization of their pages is now taboo. Simple visual inspection of the XHTML code reveals how lightweight and efficient it is compared to a table-based HTML layout. XTHML makes use of Cascading Style Sheets (CSS), which, when executed externally, strip virtually all style information from the XHTML document itself. This creates a document focused solely on content.

XHTML uses “div” tags to define areas of content. CSS controls how these “slices” are displayed. This is known as CSS-P or CSS Positioning. Changing “table” tags to “divs” can be difficult. Learning a new way to perform an already familiar task is often difficult. Just like learning how to use a different design program or image editor, the frustration can be constant. Viewing “divs” as some kind of table cell can be helpful, although they are not quite equivalent. As required by the XHTML standard, always ensure that there is a DOCTYPE definition at the top of the document. This is not only required by the standard, but will force Internet Explorer 6, currently the most common browser, into its “standards compliance” mode. IE6 and Firefox, both running in standards compliance mode, will display XHTML in the same way. Not identical, but much better than IE6 operating in quirky mode. Learning to resolve the trailing differences between screens is the last hurdle and may require some CSS tweaking.

Clean code has multiple benefits. Creates a smaller page size which, over time, can save costs associated with using transfers. Although the size difference may seem small, for someone running a heavily trafficked site, even saving a few kilobytes in size can make a world of difference. Also, some believe that search engines may look kinder on standard complaint pages. However, this is just a theory. In a general sense, any modification to the page that makes the content easier to reach and higher in code is considered smart. Search engines, it is believed, prefer to get to content quickly and give more weight to the first content they find. The use of XHTML and the “div” layout allows designers to accomplish this task more easily.

recommendations

XHTML is the current standard established by the W3C. The W3C continues to develop XHTML, and XHTML 2.0 will replace the current standard in the future. Learning and using XHTML today will help designers prepare for tomorrow. Valid XTHML does not produce errors that can slow down a browser, and the code produced is clean and efficient. This saves file size and helps designers better achieve their search engine optimization goals. Learning XHTML is mostly about learning a new way of designing pages. Although frustrating at first, the long-term benefits far outweigh any initial drawbacks.

Leave a Reply

Your email address will not be published. Required fields are marked *