XHTML

XHTML

XHTML ( EXtensible HyperText Markup Language), developed by World Wide Consortium (W3C) in 2000, is the more extended version of the popular HTML. It is the same HTML but defined as an XML application, which combines the advantages of both HTML and XML. (XHTML (可扩展超文本标记语言)由World Wide Consortium ( W3C )于2000年开发,是流行的HTML的更扩展版本。它是相同的HTML ,但被定义为XML应用程序,它结合了HTML和XML的优点。)

XHTML retains all the features of HTML but introduced more strict rules for creating pages, which allows you to make sites independent of the display device and browser. It means that the site will be correctly displayed in all modern browsers and platforms like computers, smartphones, PDAs, etc. (XHTML保留了HTML的所有功能,但引入了更严格的页面创建规则,允许您使网站独立于显示设备和浏览器。这意味着该网站将在所有现代浏览器和平台(如计算机、智能手机、PDA等)中正确显示。)

XHTML is supported by all modern browsers. (所有现代浏览器都支持XHTML。)

Difference between HTML and XHTML

Difference between HTML and XHTML (HTML和XHTML的区别)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>Title of the document</title>
 </head>
 <body>
   Content of the page
(页面内容)
 </body>
</html>

Benefits of XHTML

Benefits of XHTML (XHTML的优势)

  • The fact that in XHTML all tags must be closed and nested correctly makes the code look much cleaner. (-在XHTML中,所有标签都必须关闭并正确嵌套,这使得代码看起来更干净。)

  • XHTML uses less bandwidth, which reduces cost especially if your site has thousands of pages. (- XHTML使用更少的带宽,这降低了成本,特别是当您的网站有数千个页面时。)

  • Thanks to being well-formed, XHTML documents are easily transported to wireless devices, Braille readers and other specialized web environments. (-由于格式良好, XHTML文档可以轻松传输到无线设备、盲文阅读器和其他专用网络环境。)

  • XHTML works with CSS to create web pages easily. (- XHTML与CSS配合使用,可轻松创建网页。)

XHTML vs HTML

XHTML vs HTML (XHTML与HTML)

HTML is the main markup language for creating web pages, while XHTML, as mentioned above, is the extended version of it. HTML is an application of Standard Generalized Markup Language (SGML), while XHTML is an application of XML. HTML is extended from SGML, and XHTML from XML and HTML. HTML was created by Tim Berners-Lee in 1987(Wikipedia)and XHTML was proposed by World Wide Consortium in 2000 (Wikipedia). And the last difference between these two is the flexible framework requiring lenient HTML specific parser in case of HTML and restrictive subset of XML which needs to be parsed with standard XML parser in case of XHTML.

XHTML vs HTML5

XHTML vs HTML5 (XHTML与HTML5)

XHTML is case sensitive, while HTML5, as well as HTML, are not. XHTML has much more complex doctypes than HTML5. The next difference is browser compatibility: HTML5 is supported by all the browser, while XHTML is not. HTML5 is better suited for mobile devices, whereas XHTML is better suited for computer screens. And one more difference is that HTML5 is more lenient that XHTML.



请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部