Monday, 23 January 2012

Differences Between HTML and XHTML

Even though this is a CSS reference, we should spend some time talking about HTML and XHTML, because your choice of markup language will affect how CSS is applied in some instances. Moreover, in order to understand the variations in the way CSS is applied to HTML and XHTML, you need to grasp the fundamental differences between the two markup languages.
The most important difference between the two markup languages is thatHyperText Markup Language, or HTML, is an application of SGML (Standard Generalized Markup Language), and allows an author to omit certain tags and use attribute minimization
The Extensible Hyper Text 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. However, it provides a shorthand notation for empty elements—for example, we could use <br/> instead of <br></br>—which HTML does not. A conforming XML document must be well formed, which, among other things, means that there must be an end tag for every start tag, and that nested tags must be closed in the right order.
When an XML parser encounters an error relating to the document’s well-formlessness, it must abort, whereas an HTML parser is expected to attempt to recover and continue.

No comments:

Post a Comment