Development of the XHTML language has gone through several phases or levels. Standards have been developed by the World Wide Web Consortium that define the characteristics of XHTML at each level. The problem of browser-compatibility exists because companies that develop web browsers don't uniformly follow the XHTML standards, either by intent because they want to market more advanced features, or by different interpretation of the standards. Techniques, known as XHTML Validation, have been developed to test the compliance of web pages with the XHTML standards. Computer programs, both online and offline, are available to perform the testing. Web sites that pass validation tests are more likely to look similar on different browsers. XHTML DOCTYPEBefore you try to validate your web pages, you should insert a DOCTYPE statement before the <html> statement in each page to identify the version of XHTML supported by the page. Unless your WYSIWYG editor can generate DOCTYPE statements, you will have to do this in the XHTML level of editing (the following XHTML statements must be entered as one-line statements). XHTML 3.2If you are creating your web site per the HTML 3.2 standard for older browsers only, each web page must have the following DOCTYPE statement. These pages must be written in HTML.
XHTML 4.01If you are creating your web site per the HTML 4.01 standard, for the latest browsers, your pages must be written in XHTML and must have one of the DOCTYPE statements defined by the 4.01 Document Type Definitions (DTD). The DOCTYPE statements must be placed in your page as one line. They are shown in this page as two lines due to the limited width of this page for viewing. The syntax differences between HTML and XHTML are given in the Learning HTML page. XHTML 4.01 Strict DTDThe Strict DTD includes all XHTML elements and attributes that have not been declared outdated or obsolete. Thus, pages declaring themselves as "strict" will not be displayed properly on browsers not supporting HTML 4.01. That is, this DTD does not allow for backwards compatibility with older browsers.
XHTML 4.01 Transitional DTDThe Transitional DTD includes everything in the Strict DTD plus elements and attributes that have been declared outdated. This DTD thus provides backwards compatibility with older browsers. (FYI: no browsers are required to support obsolete elements and attributes). Pages written for the 4.01 standard can be written in either HTML or XHTML.
XHTML 4.01 Frameset DTDThe Frameset DTD includes everything in the Transitional DTD plus frames.
Which DOCTYPE Do I Use?If you expect your target audience to have browsers that support XHTML 4.01 (Netscape 4.0, Internet Explorer 4.0 or later), then develop your web site for 4.01 (using XHTML) and use the Transitional DOCTYPE for pages that do not contain frames and the Frameset DOCTYPE for pages that do contain frames. If your audience will have browsers that support HTML 3.2 but not XHTML 4.01 (older versions of browsers) then develop your web site for 3.2 and use the 3.2 DOCTYPE. Validation SoftwareThe Links page of this web site gives links to validation programs that can be used to validate your site. The programs do this by examining your XHTML for its compliance with the standards. As you validate each page, determine the cause of the errors detected and make the appropriate changes. Try different validation programs, because they may not give exactly the same results. Your instructor will use the Doctor HTML (click on Single Page) program to grade your site. If you are using a WYSIWYG editor, you will not have complete control over the generated XHTML tags. This means that you may have validation errors that you can not fix.
|