XHTML 1.1

Many of you may have done some surfing and found that XHTML 1.0 is not the latest standard of XHTML. Instead, XHTML 1.1 is the latest standard of XHTML published by the W3C.

The solar system page as covered in this tutorial validates just fine as XHTML 1.1 simply by removing the name attribute from the map element and changing the DOCTYPE declaration to:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

The main reason this tutorial did not specifically cover XHTML 1.1 is because of the content type, also known as the MIME type. If you recall from the metadata section of this tutorial, a MIME type indicates media format for a resource and its default format. Programs use this MIME type to determine how to use the data content.

To recap, HTML uses the MIME type text/html. XHTML 1.0 can also use text/html but also the more appropriate application/xhtml+xml type. For XHTML 1.1, you should not use text/html but instead use application/xhtml+xml. The main problem is that Internet Explorer 6.02 (and earlier) does not support the application/xhtml+xml type. Your XHTML 1.1 pages will not display for folks using Internet Explorer if you serve your pages according to the standard, which is using the application/xhtml+xml MIME type. And alot of people still use Internet Explorer.

There are methods to work around this, for example to specify text/html for Internet Explorer users. However, they involve either server-side scripting or content negotiation (your web page server would have to support this). Not all ISP servers support content negotiation, and server-side scripting is beyond the scope of this tutorial.

There are minor differences in XHTML 1.0 Strict and XHTML 1.1 in terms of tags used in markup. I personally write my pages using XHTML 1.1 (I use server-side scripting to determine which MIME type to use), and wrote this tutorial so that you will not have to "unlearn" anything to upgrade to XHTML 1.1 in the future. All you would have to do is update your DOCTYPE declaration.

Differences between XHTML 1.0 Strict and XHTML 1.1

  1. The DOCTYPE declaration is:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    instead of
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
  2. The lang attribute has been completely removed in favor of the xml:lang attribute. Since xml:lang is already defined for XHTML 1.0, this tutorial used xml:lang anyway.
  3. The name attribute for a and map elements has been completely removed in favor of the id attribute. This tutorial uses both the id and nameattributes. The name attribute specified for the image map (map element) would have to be removed.
  4. The Ruby collection of elements was added to XHTML. These elements are designed to support internationalization, and are not covered in this tutorial.

Introduction | Getting Started | A Basic XHTML Page | Basic Tags | Quotations | Tables | Text Links | Images | Image Links | Image Maps | Finishing Touches | Additional Tags | Conclusion | XHTML 1.1