Differences between XHTML 1.0 and HTML 4.0


Previous Topic Previous Next Topic Next
Xoc Software

Other Xoc managed sites:
http://grr.xoc.net
http://www.986faq.com
http://www.mayainfo.org
https://mayacalendar.xoc.net
http://www.yachtslog.com

Differences between what you are currently doing in HTML and what is necessary for XHTML 1.0. Excerpted from the XHTML 1.0 spec, which you can reference for more details and examples. Xoc Software strongly recommends encoding web pages using the XHTML 1.0 spec, but using the feature set of tags and attributes from the HTML 3.2 spec.

  1. Documents must be well-formed
  2. Element and attribute names must be in lower case
  3. For non-empty elements, end tags are required
  4. Attribute values must always be quoted
  5. Attribute Minimization is not supported
  6. Empty elements must either have an end tag or the start tag must end with />
  7. Whitespace handling in attribute values is different
  8. Enclose script and style elements in CDATA sections
  9. Certain elements cannot be enclosed in other elements
  10. Use the id attribute to identify fragments, not name

A couple of additional points:

  1. Place a space before empty closing tags, as in <br />
  2. Don't use the abbreviation for empty elements where you don't have to. In other words, use <meta></meta> rather than <meta />. The main two you must use empty elements on are <br /> and <hr />. Some of the search engines don't seem to process empty elements correctly.

Top