Change of syntax

While based on HMTL, XHTML conforms to the XML standard. This requirement affects some of the markup conventions used.

Lower-case names

Element and attribute names are case-sensitive in XML, and for XHTML it was decided to use lower-case letters for all elements and attributes. In HTML it is possible to use 'meta', 'Meta' or 'META' (or any other combination) for the Meta element, but it must be 'meta' in XHTML.

Empty elements

All empty elements must end with '/>', and for compatibility with older Web browsers, it is recommended that there is a preceding space ('<… />'):

 <area .../> <base ... /> <basefont ... /> <br ... /> <col ... /> <frame ... /> <hr ... /> <img ... /> <isindex ... /> <link ... /> <meta ... /> <param ... /> ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.