XHTML
2014-04-14 10:57
113 查看
XHTML is HTML written as XML.
XHTML stands for EXtensible HyperText Markup Language 可扩展的HTML
XHTML is almost identical to HTML,
stricter than HTML
XHTML is HTML defined as an XML application
XHTML is supported by all major browsers
现在市场上有许多不同的浏览器技术,一些运行在电脑上,一些则是在移动电话或小型设备上。
Smaller devices often lack the resources or power to interpret a "bad" markup language.
小型设备往往缺乏资源和能力去翻译一个“不好”的标记语言。
Therefore - by combining the strengths of HTML and XML, XHTML was developed.
XHTML is HTML redesigned as XML(可扩展标记语言,designed
to transport and store data).
The xmlns attribute in <html>, must specify the xml namespace for the document 必须指明文件的XML命名空间
<html>, <head>, <title>, and <body> is mandatory(必须出现)
XHTML elements must always be closed,
一般元素必须闭合 <p>...</p>
[b]空元素也必须闭合 <br/> <img
/>
[/b]
XHTML elements must be in lower case 小写
Attribute values must be quoted 被双引号扩住
Attribute minimization is forbidden 禁止简写
关于 Attribute minimization 错误的例子:
正确写法:
XHTML stands for EXtensible HyperText Markup Language 可扩展的HTML
XHTML is almost identical to HTML,
stricter than HTML
XHTML is HTML defined as an XML application
XHTML is supported by all major browsers
Why XHTML?
Today's market consists of different browser technologies. Some browsers run on computers, and some browsers run on mobile phones or other small devices.现在市场上有许多不同的浏览器技术,一些运行在电脑上,一些则是在移动电话或小型设备上。
Smaller devices often lack the resources or power to interpret a "bad" markup language.
小型设备往往缺乏资源和能力去翻译一个“不好”的标记语言。
Therefore - by combining the strengths of HTML and XML, XHTML was developed.
XHTML is HTML redesigned as XML(可扩展标记语言,designed
to transport and store data).
The Most Important Differences from HTML:
Document Structure 文本结构
XHTML DOCTYPE is mandatory 强制性的The xmlns attribute in <html>, must specify the xml namespace for the document 必须指明文件的XML命名空间
<html xmlns="http://www.w3.org/1999/xhtml">
<html>, <head>, <title>, and <body> is mandatory(必须出现)
XHTML Elements 元素
XHTML elements must be properly nested 元素必须正确地嵌套,error example:<p><a></p></a>XHTML elements must always be closed,
一般元素必须闭合 <p>...</p>
[b]空元素也必须闭合 <br/> <img
/>
[/b]
XHTML elements must be in lower case 小写
XHTML Attributes 属性
Attribute names must be in lower case 小写Attribute values must be quoted 被双引号扩住
Attribute minimization is forbidden 禁止简写
关于 Attribute minimization 错误的例子:
<input checked> <input readonly> <input disabled> <option selected>
正确写法:
<input checked="checked"> <input readonly="readonly"> <input disabled="disabled"> <option selected="selected">
相关文章推荐
- XHTML教程:Transitional和Strict的区别
- [XHTML Tutorial] 走向XHTML标准 (6)(XHTML HOWTO)
- [XHTML Tutorial] 走向XHTML标准 (4)(XHTML Syntax)
- 谈一下关于XHTML网页的制作
- [转帖]学习使用XHTML的12天
- XHTML的目标,规则和细节
- 网站首页head区代码规范 xhtml文档类型
- XHTML代码规范
- HTML中几个Tag比较有用,平时大家用得比较少,而且是符合W3C XHTML标准的。
- XHTML+CSS=网站重构
- XHTML+css,web标准学习笔记1——DOCTYPE声明
- XHTML的规则
- 关于WML、HDML、CHTML、XHTML
- 符合XHTML1.0规范的flash植入方法
- 高人的文章:关于loose.dtd和xhtml1-transitional.dtd等文档类型定义模型中CSS失效的解决办法。
- xhtml中推荐和不推荐的标签
- XHTML常用标签
- 总结基本Tags在XHTML1.0各DTD的校检数据
- XHTML下插入能通过W3C检验的Flash代码
- Web2.0下XHTML+CSS 设计需要注意的地方小结