Computerhelp4all logo Articles AboutTopicsQuizzesComputer Questions & AnswersComputer Terms & DefinitionsActivitiesContact

What Is XHTML?

What Is XHTML

Date First Published: 27th November 2022

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 6/10

Learn more about what XHTML is in this article.

XHTML is an XML-based version of HTML that extends HTML and XML and allows it to work with other data formats, such as XML. It works in a similar way to HTML, allowing font, colour, graphics, and hyperlinks to be achieved and instructing the web browser on how to display elements, but XHTML documents are parsed using standard XML parsers rather than a less strict HTML-specific parser. The main difference between HTML and XML is that XHTML is much stricter than HTML in syntax and case sensitivity as unlike HTML, one error in an XHTML document will cause the whole file to fail when processed for output.

Note: Info Icon

XHTML is not a programming language. It is a markup language that combines the features of XML and HTML.


Note: Info Icon

XHTML documents end with the file extension '.xhtml' or '.xht'. The file extension '.xhtml' is much more common than '.xht'.

Differences Between HTML and XHTML

The differences between HTML and XHTML are:

  • <DOCTYPE> is required
  • <html>, <head>, <title>, and <body> are required.
  • Elements must always be properly closed.
  • Elements must always be in lowercase.
  • Attribute names must always be lowercase.
  • Attribute values must always be quoted.
  • Attribute minimisation is disallowed.
  • Elements must always be properly nested within each other. For example, if an XHTML document had text that was defined as bold and italic and the <b> tag came first and the <i> tag next, the tags must be in the right order, which is <b><i>Text</i></b>, not <b><i>Text</b></i>.

History

XHTML became a W3C recommendation on 26th January 2000 and XHTML 1.1 became a W3C recommendation on 31st May 2001. The standard known as XHTML5 is being developed as an XML adaptation of the HTML5 specification.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.


Comments

What Is Computerhelp4all?

  • Computerhelp4all is a site with articles for everyone about the topic of computing, as suggested in the name '4all'.


Follow Computerhelp4all

Search