History

It was developed by the World Wide Web Consortium (W3C) and helps web developers transition from HTML to XML. With XHTML, developers can enter the XML world with all its features while still ensuring backward and future compatibility of the content. The XHTML family includes three document types; the first is XHTML 1.0, which was recommended by W3C on January 26, 2000. The second is XHTML 1.1, which was recommended by W3C on May 31, 2001.

The third is XHTML5, a standard used for developing an XML adaptation of the HTML5 specification. An XHTML document must have an XHTML <!DOCTYPE> declaration.

Elements of XHTML:

XHTML Element Description
<!DOCTYPE> Used to declare the Document Type Definition (DTD), specifying the rules for the markup language, ensuring proper rendering in browsers.
<html> Encloses the entire HTML or XHTML document, serving as the root element.
<head> Contains meta-information about the document, such as the title, character set, linked stylesheets, and other essential elements.
<title> Nested within the head section, specifies the title of the document, displayed in the browser’s title bar or tab.
<body> Encloses the content of the web page, including text, images, links, and other HTML elements. It represents the visible part of the document displayed in the browser.

When creating an XHTML web page, it is necessary to include a DTD (Document Type Definition) declaration. There are three types of DTD which are discussed below:

XHTML Introduction

XHTML or EXtensible HyperText Markup Language is a mix of HTML and XML, very similar to HTML but stricter. It’s like a rulebook for creating web pages that browsers easily understand. Unlike HTML, you have to be careful and follow the rules exactly. Most browsers support it. Just think of it as a more precise way to write web code.

Table of Content

  • History
  • Transitional DTD
  • Strict DTD
  • Frameset DTD
  • Why use XHTML?
  • Benefits of XHTML
  • Difference Between HTML and XHTML

Similar Reads

History

It was developed by the World Wide Web Consortium (W3C) and helps web developers transition from HTML to XML. With XHTML, developers can enter the XML world with all its features while still ensuring backward and future compatibility of the content. The XHTML family includes three document types; the first is XHTML 1.0, which was recommended by W3C on January 26, 2000. The second is XHTML 1.1, which was recommended by W3C on May 31, 2001....

Transitional DTD:

It is supported by the older browsers which do not have inbuilt cascading style sheets supports. Several attributes are enclosed in the body tag which are not allowed in strict DTD....

Strict DTD:

...

Frameset DTD:

Strict DTD is used when XHTML page contains only markup language. Strict DTD is used together with cascading style sheets, because this attribute does not allow CSS property in body tag....

Why use XHTML?

...

Benefits of XHTML:

The frameset DTD is used when XHTML page contains frames. This DTD is identical to the HTML 4.01 Transitional DTD except for the content model of the HTML element....

Difference Between HTML and XHTML:

...