Home > Article > Web Front-end > XML, XHTML, HTML related knowledge summary_html/css_WEB-ITnose
1. What is XML, XHTML, HTML?
According to W3C definition, xml refers to Extensible Markup Language (Extension Markup Language) and is designed to transmit data. , instead of displaying data, tags in XML are not predefined, you can define tags yourself, it is a standard recommended by W3C.
XHTML: Extensible HyperText Markup Language (Extensible HyperText Markup Language), which is HTML redefined as an XML application. The design goal is to replace HTML. It is almost the same as HTML4.01 Yes, it is a stricter and purer version of HTML, and it is also a standard of W3C.
HTML: Hyper Text Markup Language (Hyper Text Markup Language)
2. Why is there XHTML when there is HTML?
Firstly, W3C believes that many web pages on the World Wide Web contain bad HTML code, even if they do not follow HTML rules, they can still work well
<html><head><title>This is bad HTML</title><body><h1>Bad HTML</body> ----------------摘自w3c手册
Secondly It is too simple because it cannot adapt to the needs of more and more network devices and applications now. For example, mobile phones, PDAs, and information appliances cannot directly display HTML. Almost all devices support XML, but it is not designed to display data, so combining the strengths of the two, XHTML was born, which allows us to write well-structured documents that can work better on All browsers and backwards compatible.
3. The main differences between XML and HTMl
XML 不是 HTML 的替代。XML 和 HTML 为不同的目的而设计:XML 被设计为传输和存储数据,其焦点是数据的内容。HTML 被设计用来显示数据,其焦点是数据的外观。HTML 旨在显示信息,而 XML 旨在传输信息。 -----------摘自w3c
4. The main differences between XHTML and HTML
XHTML 元素必须被正确地嵌套。 XHTML 元素必须被关闭。(空标签和非空标签) 标签名必须用小写字母。 XHTML 文档必须拥有根元素。 XHTMl 属性值要加双引号。 -------摘自w3c手册----------
5. Three document types of confusion. Please use it with Cascading Style Sheets.
Transitional:
1 <!DOCTYPE html2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Used in this situation: when you need to take advantage of the presentational features of HTML, and when you need to provide support for those that do not support cascading styles Table of browsers when writing XHTML.
Frameset:
1 <!DOCTYPE html2 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Used in this situation: When you need to use HTML frames to split the browser window into two or more frames.
6. Current status of XHTML and HTML5
1 <!DOCTYPE html2 PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">XHTML is dead, but some of its syntax is still highly sought after by many web developers. The new version of HTML5 is HTML, XHTML and the new standard for HTML DOM. On October 28 this year,
W3C
announced that it has been formulated. More and more browsers have begun to support HTML5 related features. Please stay tuned to see whether browser compatibility issues will be improved.