XHTML

  • Stands for EXtensible HyperText Markup Language.
  • Is almost identical to HTML.
  • Is stricter than HTML.
  • Is HTML defined as an XML application.

Why XHTML?

This HTML code works fine in most browsers (even if it does not follow the HTML rules):

<html>
<head>
  <title>This is bad HTML</title>

<body>
  <h1>Bad HTML
  <p>This is a paragraph
</body>
  • Many pages on the internet contain "bad" HTML.
  • Smaller devices often lack the resources or power to interpret "bad" markup.
  • XHTML was developed by combining the strengths of HTML and XML.

How to Convert from HTML to XHTML

  • Add an XHTML <!DOCTYPE> to the first line of every page.
  • Add an xmlns attribute to the html element of every page.
  • Change all element names to lowercase.
  • Close all empty elements.
  • Change all attribute names to lowercase.
  • Quote all attribute values.

Differences from HTML

XHTML — Structure map

Clickable & Draggable!

XHTML — Related pages: