The W3C recently announced that it will terminate its contract with the XHTML 2 working group from the end of 2009, implying the official death of the once ambitious XHTML 2. Should the web design community panic? After all, XHTML 1. The new favorite, HTML 5.
What do you think of XHTML, which is loved by Web designers?
To understand how XHTML gained people's favor, we have to start with HTML4. HTML 4 is a loose language that has many options and incorporates too many people's experimental ideas for the Web, some good and some bad. However, HTML 4 is responsible for poor web code, such as The English language is responsible for bad fiction. HTML 4 can be well-structured and have legal semantics, as long as designers know how to use it.
XHTML 1.0 is more strict, and those validation tools are easier to point out errors. If you are lazy and want to ensure that your code structure is rigorous, XHTML 1.x is much easier to check.
However, the problem is that the mission of XHTML is not just that. The mission of XHTML lies in the X in its name. The existence of X is not to be cool, but because XHTML actually belongs to XML. As Henri Sivonen, who is working on the HTML 5 specifications, pointed out, XHTML actually has two meanings, one is technical and the other is marketing.
From a technical point of view, XHTML was originally intended to output pure XML with the application/xhtml+xml MIME type. However, this situation is rare. This does not mean that XML is not important. In fact, the future XHTML 5 will provide sequences for HTML 5. services. The extensive use of XHTML is more based on the market perspective. In other words, web pages that use XHTML syntax are still rendered by browsers according to the text/html MIME type. Therefore, although these documents belong to XML, they are not treated as True XML, but rendered as HTML.
Why do people like XHTML?
Since XHTML is HTML, what are the original intentions of those who like XHTML? The answer is that XHTML encourages good coding habits, all tags need to be complete and rigorous, and XHML can produce cleaner code than HTML 4.
However, HTML 5 has solved most of these problems in HTML 4. It allows you to use XHTML 1. XHTML 1.x code can be converted directly to HTML 5 with just a doctype change.
What's wrong with XHTML 2.0?
Despite its good intentions, XHTML 2.0 died due to two things. First, it was not forward compatible, which meant that the XHTML 1.x code you wrote could not be directly used in XHTML 2.0. On the contrary, HTML 5 was forward compatible. . Second, XHTML 2.0 is not the XMLization of HTML, but a completely new system that ignores the needs of designers.
However, HTML 5 contains many things that designers need, including local audio and video support, multi-column layout tools, offline databases, and local vector graphics support. XHTML has not touched any of these.
A bright future for HTML 5
Although XHTML 2.0 has been proposed for many years, no browser has implemented any support for it so far. HTML 5 has been favored by almost all modern browsers, including Firefox, Safari, Chrome, Opera, and even IE8 has implemented it. some support.
Big companies that are ambitious in the Web field, such as Google and Apple, have launched Web services based on HTML 5 and implemented various applications using localized video support and local databases. However, there are almost no applications based on XHTML 2.0.
In addition, HTML 5 also introduced XHTML 5 details. XHTML 5 extends an olive branch to a large number of web pages based on XHTML 1.x in the current Web. Abandonment, in fact, would work better.