Differences between HTML and XHTML

This section describes differences between HTML and XHTML. XHTML is XML based and more restrictive than HTML.

XHTML (Extensible HyperText Markup Language) is an XML based markup language that mirrors HTML language. The current version is XHTML 1.1 released in November 2010.

Main differences between HTML and XHTML are:

Here is a good example of an XHTML document from http://www.javascriptkit.com/howto/xhtml_intro4.shtml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "DTD/xhtml1-strict.dtd">
<!-- XHTML_Example.html
 - Copyright (c) 2014, HerongYang.com, All Rights Reserved.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Strict DTD XHTML Example </title>
</head>
<body>
<p>Please Choose a Day:<br/><br/>
<select name="day">
  <option selected="selected">Monday</option>
  <option>Tuesday</option>
  <option>Wednesday</option>
</select>
</p>
</body>
</html>

Last update: 2014.

Table of Contents

 About This Book

Introduction of HTML

 What Is HTML?

 History of HTML

Differences between HTML and XHTML

 Relation between HTML and CSS

 Relation between HTML and JavaScript

 Relation between HTML and DOM

 Relation between HTML and DHTML

 Relation between HTML and SVG

 Introduction of HTML5 Features

 HTML Document Structure and Content

 HTML Document and Elements Syntax

 References

 PDF Printing Version