Skip to main content

XHTML Introduction

What is XHTML?

XHTML stands for EXtensible HyperText Markup Language. It is the next step in the evolution of the internet. The XHTML 1.0 is the first document type in the XHTML family.

XHTML is almost identical to HTML 4.01 with only few differences. This is a cleaner and stricter version of HTML 4.01. If you already know HTML, then you need to give little attention to learn this latest version of HTML.

XHTML was developed by World Wide Web Consortium (W3C) to help web developers make the transition from HTML to XML. By migrating to XHTML today, web developers can enter the XML world with all of its benefits, while still remaining confident in the backward and future compatibility of the content.

Why Use XHTML?

Developers who migrate their content to XHTML 1.0 get the following benefits:

  • XHTML documents are XML conforming as they are readily viewed, edited, and validated with standard XML tools.
  • XHTML documents can be written to operate better than they did before in existing browsers as well as in new browsers.
  • XHTML documents can utilize applications such as scripts and applets that rely upon either the HTML Document Object Model or the XML Document Object Model.
  • XHTML gives you a more consistent, well-structured format so that your webpages can be easily parsed and processed by present and future web browsers.
  • You can easily maintain, edit, convert and format your document in the long run.
  • Since XHTML is an official standard of the W3C, your website becomes more compatible with many browsers and it is rendered more accurately.
  • XHTML combines strength of HTML and XML. Also, XHTML pages can be rendered by all XML enabled browsers.
  • XHTML defines quality standard for your webpages and if you follow that, then your web pages are counted as quality web pages. The W3C certifies those pages with their quality stamp.

Example

<?xml version="1.0" encoding="UTF-8"?>

<!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/TR/xhtml1" xml:lang="en" lang="en">
<head>
<title>Your Title</title>
</head>
<body>
... your contents ...
</body>
</html>