当前位置: 首页 > 网络学院 > 网页制作基础教程 > XHTML > 为什么使用 XHTML

XHTML
XHTML 介绍
为什么使用 XHTML
XHTML 对比 HTML
XHTML 语法
XHTML DTD
怎样转换成 XHTML
XHTML 校验
XHTML 模块
XHTML 属性
XHTML 事件
XHTML 摘要

XHTML 中的 为什么使用 XHTML


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 650 ::
收藏到网摘: n/a

XHTML is a combination of HTML and XML (EXtensible Markup Language).
XHTML是HTML和XML(可扩展标记语言)的组合

XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML.
XHTML将XML的语法和所有HTML4.01的元素结合起来


Why XHTML?
为什么使用XHTML?

We have reached a point where many pages on the WWW contain "bad" HTML.
可以注意到网上有许多"糟糕(代码乱糟糟)"的HTML页面

The following HTML code will work fine if you view it in a browser, even if it does not follow the HTML rules:
以下并未遵循语法规则的代码在浏览器中依然能够正确的显示:

<html>
<head>
<title>This is bad HTML</title>

<body>
<h1>Bad HTML
</body>

XML is a markup language where everything has to be marked up correctly, which results in "well-formed" documents.
XML是一种合理使用标记的语言(对标记的规范性十分的严格)

XML was designed to describe data and HTML was designed to display data. 
XML被用来描述数据而HTML则被用来显示数据(一个内容一个外表)

Today's market consists of different browser technologies, some browsers run Internet on computers, and some browsers run Internet on mobile phones and hand helds. The last-mentioned do not have the resources or power to interpret a "bad" markup language.
目前市场上有多种浏览器技术,有运行在普通PC机上的,手机或其他一些移动设备上的等等,要说明的是请别让任何一款浏览器花费更多的资源来解释"糟糕"的标记语言

Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML.
因此,通过HTML和XML的结合,发挥它们各自的长处,就获得了现在并且在将来都实用的标记语言-XHTML

XHTML pages can be read by all XML enabled devices AND while waiting for the rest of the world to upgrade to XML supported browsers, XHTML gives you the opportunity to write "well-formed" documents now, that work in all browsers and that are backward browser compatible !!!
等到其它浏览器都升级至支持XML的时候,XHTML能够被所有支持XML的设备读取,现在XHTML给你一个“加工”HTML文档的机会,让这些文档能够在所有的浏览器中查看,并且有良好的向后兼容性。

评论 (0) All

登陆 | 还没注册?