Why XHTML?

NOTE: There are a myriad of other reasons besides search engine optimization and marketing to use tableless layouts, CSS, and XHTML. However, these have been discussed at length throughout the various discussion boards, blogs, and forums on the Internet, and the purpose of this page is not to rehash those arguments (as valid as they may be). This page is strictly here to touch on the search engine reasoning behind standards-compliant code.

There are two major reasons why using XHTML/tableless layouts and CSS will allow you as a search engine marketer to maximize the on-the-page effectiveness of the websites that you market:

  1. Reduced code. Tables tend to require more code than divs do in the majority of cases. For example, consider the following two code samples, each designed to produce a block of text, padded by 5 pixels:

    Sample 1: Pure HTML (also valid XHTML)

    <table cellspacing="0" cellpadding="5">
    <tr>
    <td>
    Padded Text
    </td>
    </tr>
    </table>
    

    Sample 2 HTML/XHTML and CSS:

    <div style="padding:  5px;">
    Padded Text
    </div>
    

    Sample 2 accomplishes the same purpose as Sample 1 with a significant reduction in code, and the result appears the same across the major browsers. Reduced code means:

    • quicker page load times;
    • fewer validation/coding errors;
    • a greater likelihood that a search engine will be able to spider the site correctly.
  2. The ability to alter the loading order of the major elements of a page. CSS and XHTML, properly designed, allow for the alteration of code order without impacting the design. This means that a savvy CSS webmaster has the option of putting the content of his/her pages first, second, third, fourth or even last if necessary. This depends on the purpose the webmaster is trying to accomplish.

    My own personal preference is to ensure that whatever div I choose to use as my content div will load first and foremost, before any menus, submenus, headers, footers, logos, etc. This serves two purposes:

    • search engine spiders can quickly discern what a page is about from the body copy;
    • users are able to view the content of the site as quickly as possible, without having to wait for the non-content elements of a site such as menus, logos and other such items to load.

    All Search Engine Friendly Layouts are coded with this basic principle in mind; present the content first to both users and search engine spiders. However, the order of the code can be altered in any way the webmaster sees fit.

This website is for sale!