Skip to main content
table of contents
XHTML
- HTML has gone through several revisions to add new features and make it more consistent.
- XHTML is a standardized version of HTML that uses pure XML syntax:
- Looks just like regular HTML in most respects.
- All elements must be formally closed (e.g., must specify
</p>
). - Elements must nest hierarchically.
- All attributes must have explicit values: instead of
<select name="state" disabled>
, specify<select name="state" disabled="disabled">
- There is a DTD for XHTML, so you can validate XHTML with any XML validator, such as
xmlvalid
.
Sample XHTML
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//
DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/
DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<p>
Hello world!
</p>
</body>
</html>
Annotate
Web Technology