eXtensible Hypertext Markup Language: HTML Written as XML
XHTML stands for eXtensible Hypertext Markup Language:
Why using XHTML?
Many pages on the internet contain "bad" HTML. 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
</body>
XHTML has a few document structure differences from HTML:
<html>
is mandatory.<html>
, <head>
, <title>
, and <body>
are mandatory.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of document</title>
</head>
<body>
some content
</body>
</html>
XHTML elements:
XHTML documents:
XHTML attributes: