HTML - XHTML
XHTML 是以 XML 格式编写的 HTML。
在海曙等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站设计制作、成都做网站 网站设计制作定制网站设计,公司网站建设,企业网站建设,成都品牌网站建设 ,全网营销推广 ,成都外贸网站建设公司,海曙网站建设费用合理。
什么是 XHTML?
XHTML 指的是可扩展超文本标记语言
XHTML 与 HTML 4.01 几乎是相同的
XHTML 是更严格更纯净的 HTML 版本
XHTML 是以 XML 应用的方式定义的 HTML
XHTML 是 2001 年 1 月发布的 W3C 推荐标准
XHTML 是大小写敏感的,标准的 XHTML 标签应该使用小写。
XHTML 得到所有主流浏览器的支持
为什么使用 XHTML? 因特网上的很多页面包含了"糟糕"的 HTML。
如果在浏览器中查看,下面的 HTML 代码运行起来非常正常(即使它并未遵守 HTML 规则):
This is bad HTML
Bad HTML
This is a paragraph
XML 是一种必须正确标记且格式良好的标记语言。
如果希望学习 XML,请阅读我们的 XML 教程。
今日的科技界存在一些不同的浏览器技术。其中一些在计算机上运行,而另一些可能在移动电话或其他小型设备上运行。小型设备往往缺乏解释"糟糕"的标记语言的资源和能力。
所以 - 通过结合 XML 和 HTML 的长处,开发出了 XHTML。XHTML 是作为 XML 被重新设计的 HTML。
与 HTML 相比最重要的区别: 文档结构
XHTML DOCTYPE 是强制性的
中的 XML namespace 属性是强制性的
、
、 以及 也是强制性的
元素语法
XHTML 元素必须正确嵌套
XHTML 元素必须始终关闭
XHTML 元素必须小写
XHTML 文档必须有一个根元素
属性语法
XHTML 属性必须使用小写
XHTML 属性值必须用引号包围
XHTML 属性最小化也是禁止的
注:在HTML中有时候会存在name=value的情况(即属性名等于属性值的情况),在不规范的HTML中,可以使用完整的写法,也可以使用最小化属性写法(只写属性名,不写属性值,这个时候属性值等于属性名),以check属性为例:
在HTML中,这两种写法都是可以的。但是在XHTML中,不能使用属性最小化写法。
另外,在很多地方,可能会将属性最小化表达为缩写或者简写,其想表达的意思可能与原意相同。但使用属性最小化的说法比较官方也比较通用 !
是强制性的 XHTML 文档必须进行 XHTML 文档类型声明(XHTML DOCTYPE declaration)。
您可以在 W3Cschool 的标签参考手册中找到完整的 XHTML 文档类型。
,
,
, 和 元素也必须存在,并且必须使用 中的 xmlns 属性为文档规定 xml 命名空间。
下面的例子展示了带有最少的必需标签的 XHTML 文档:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Title of document
......
XHTML 元素必须合理嵌套 在 HTML 中,一些元素可以不互相嵌套,像这样:
This text is bold and italic
在 XHTML 中,所有的元素都必须互相合理地嵌套,像这样:
This text is bold and italic
XHTML 元素必须有关闭标签 错误示例:
This is a paragraph
This is another paragraph
正确示例:
This is a paragraph
This is another paragraph
空元素必须包含关闭标签 错误示例:
A break:
A horizontal rule:
An image:
正确示例:
A break:
A horizontal rule:
An image:
XHTML 元素必须是小写 错误示例:
This is a paragraph
正确示例:
This is a paragraph
属性名称必须是小写 错误示例:
正确示例:
属性值必须有引号 错误示例:
正确示例:
不允许属性简写 错误示例:
正确示例:
如何将 HTML 转换为 XHTML
添加一个 XHTML 到你的网页中
添加 xmlns 属性添加到每个页面的html元素中。
改变所有的元素为小写
关闭所有的空元素
修改所有的属性名称为小写
所有属性值添加引号
使用 W3C 验证器来测试你的 XHTML 尝试一下 »
文章名称:创新互联HTML教程:HTML-XHTML
本文路径:http://jxjierui.cn/article/dpdshpo.html
基本
文件
流程
错误
SQL
调试
请求信息 : 2026-02-17 03:18:54 HTTP/1.1 GET : /article/dpdshpo.html 运行时间 : 0.0525s ( Load:0.0033s Init:0.0005s Exec:0.0427s Template:0.0060s ) 吞吐率 : 19.05req/s 内存开销 : 2,227.02 kb 查询信息 : 12 queries 5 writes 文件加载 : 36 缓存信息 : 0 gets 2 writes 配置加载 : 130 会话信息 : SESSION_ID=9n0den96fcb831iocfklmd7du1
/home/wwwroot/jxjierui.cn/index.php ( 1.12 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/ThinkPHP.php ( 4.61 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Think.class.php ( 12.26 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Storage.class.php ( 1.37 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Storage/Driver/File.class.php ( 3.52 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Mode/common.php ( 2.82 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Common/functions.php ( 53.56 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Hook.class.php ( 4.01 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/App.class.php ( 13.49 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Dispatcher.class.php ( 14.79 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Route.class.php ( 13.36 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Controller.class.php ( 11.23 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/View.class.php ( 7.59 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/BuildLiteBehavior.class.php ( 3.68 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/ParseTemplateBehavior.class.php ( 3.88 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/ContentReplaceBehavior.class.php ( 1.91 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Conf/convention.php ( 11.15 KB ) /home/wwwroot/jxjierui.cn/App/Common/Conf/config.php ( 2.12 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Lang/zh-cn.php ( 2.55 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Conf/debug.php ( 1.48 KB ) /home/wwwroot/jxjierui.cn/App/Home/Conf/config.php ( 0.32 KB ) /home/wwwroot/jxjierui.cn/App/Home/Common/function.php ( 3.33 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/ReadHtmlCacheBehavior.class.php ( 5.62 KB ) /home/wwwroot/jxjierui.cn/App/Home/Controller/ArticleController.class.php ( 6.11 KB ) /home/wwwroot/jxjierui.cn/App/Home/Controller/CommController.class.php ( 1.60 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Model.class.php ( 60.11 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Db.class.php ( 32.43 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Db/Driver/Pdo.class.php ( 16.74 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Cache.class.php ( 3.83 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Cache/Driver/File.class.php ( 5.87 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Template.class.php ( 28.16 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Template/TagLib/Cx.class.php ( 22.40 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Template/TagLib.class.php ( 9.16 KB ) /home/wwwroot/jxjierui.cn/App/Runtime/Cache/Home/7540f392f42b28b481b30614275e4e55.php ( 13.96 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/WriteHtmlCacheBehavior.class.php ( 0.97 KB ) /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Behavior/ShowPageTraceBehavior.class.php ( 5.24 KB )
[ app_init ] --START-- Run Behavior\BuildLiteBehavior [ RunTime:0.000004s ] [ app_init ] --END-- [ RunTime:0.000023s ] [ app_begin ] --START-- Run Behavior\ReadHtmlCacheBehavior [ RunTime:0.000141s ] [ app_begin ] --END-- [ RunTime:0.000153s ] [ view_parse ] --START-- [ template_filter ] --START-- Run Behavior\ContentReplaceBehavior [ RunTime:0.000075s ] [ template_filter ] --END-- [ RunTime:0.000096s ] Run Behavior\ParseTemplateBehavior [ RunTime:0.004943s ] [ view_parse ] --END-- [ RunTime:0.004965s ] [ view_filter ] --START-- Run Behavior\WriteHtmlCacheBehavior [ RunTime:0.000075s ] [ view_filter ] --END-- [ RunTime:0.000086s ] [ app_end ] --START--
1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 1' at line 1
[ SQL语句 ] : SELECT `id`,`pid`,`navname` FROM `cx_nav` WHERE ( id= ) LIMIT 1 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') LIMIT 1' at line 1
[ SQL语句 ] : SELECT `id`,`navname` FROM `cx_nav` WHERE ( id= ) LIMIT 1 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
[ SQL语句 ] : SELECT `id`,`navname` FROM `cx_nav` WHERE ( pid= ) [8] Undefined index: pid /home/wwwroot/jxjierui.cn/App/Home/Controller/ArticleController.class.php 第 47 行. [2] file_put_contents(./App/Runtime/Temp/77dbd8e3fb84c8cc38c56f2267ccd6d3.php): failed to open stream: Permission denied /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Cache/Driver/File.class.php 第 132 行. [8] Undefined index: db_host /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Db.class.php 第 120 行. [8] Undefined index: db_port /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Db.class.php 第 121 行. [8] Undefined index: db_name /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Db.class.php 第 122 行. [2] file_put_contents(./App/Runtime/Temp/3e37685b5dd6d2d60ea73ec4d23835d6.php): failed to open stream: Permission denied /home/wwwroot/jxjierui.cn/ThinkPHP/Library/Think/Cache/Driver/File.class.php 第 132 行.
0.0525s