What is the difference between HTML and XHTML?

By cavsi Category: Internet Tags:

The differences between HTML and XHTML are small. As the rules of XHTML are based on those of XML, the same exceptionally strict rules apply as with XML. The major differences are outlined below.

The most important difference between the two markup languages is that HyperText Markup Language, or HTML, is an application of SGML (Standard Generalized Markup Language)1 and allows an author to omit certain tags and use attribute minimization.

The Extensible HyperText Markup Language, or XHTML, is an application of XML (Extensible Markup Language). It doesn’t permit the omission of any tags or the use of attribute minimization. XHTML documents must start with an XHTML DocType declaration.

The following chart shows what the differences between HTML and XHTML are:

HTML 4.01XHTML 1.0
ForgivingRequires discipline and attention to detail
Correct nesting required in theoryCorrect nesting absolutely required
Some end tags optionalAll end tags required
No end tag for empty content modelEven empty content model requires end tag
Case insensitiveLowercase only
Some attribute values needn’t be quotedAll attribute values must be quoted
Certain “valueless” attribute values are OKAll attributes must have values
Less sensitive to special charactersMore sensitive to special characters
Ubiquitous name attributeId attribute preferred to name, mostly
Help us to continue answering your questions. Did you like this article? Make a reference to "https://www.cavsi.com/" or copy and paste the below HTML text:
What is the difference between HTML and XHTML?What is the difference between HTML and XHTML?What is the difference between HTML and XHTML?

Related Posts:

planetandes