XHTML中的图像标记 [英] Image Tag in XHTML

查看:68
本文介绍了XHTML中的图像标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始进入XHTML,所以我的经验相当有限。我创建了一个文档类型为XHTML 1.0 Strict的文档。

检查语法时,我收到以下错误消息:


文档类型确实不允许元素< img>元素内容

"< body>" ;.


在HTML 4.01 Transitional中这不是问题,但似乎是在

XHTML。我做错了什么?


-Fleemo

I''m just beginning to get into XHTML, so my experience is rather
limited. I''ve created a document with a doctype of XHTML 1.0 Strict.
When checking my syntax, I get the following error message:

Document type does not permit element "<img>" in content of element
"<body>".

In HTML 4.01 Transitional this isn''t a problem, but it appears to be in
XHTML. What am I doing wrong?

-Fleemo

推荐答案

fl ****** @ comcast.net 写道:
我刚刚开始进入XHTML所以我的经验相当有限。我创建了一个文档类型为XHTML 1.0 Strict的文档。
在检查我的语法时,我收到以下错误消息:

文档类型不允许元素< img> ;"元素的内容
"< body>"。

在HTML 4.01 Transitional中,这不是问题,但它似乎是在XHTML中。我做错了什么?
I''m just beginning to get into XHTML, so my experience is rather
limited. I''ve created a document with a doctype of XHTML 1.0 Strict.
When checking my syntax, I get the following error message:

Document type does not permit element "<img>" in content of element
"<body>".

In HTML 4.01 Transitional this isn''t a problem, but it appears to be in
XHTML. What am I doing wrong?




URL?



URL?


On 28/04/2005 21:14,< a href =mailto:fl ****** @ comcast.net> fl ****** @ comcast.net 写道:


[snip] ]
On 28/04/2005 21:14, fl******@comcast.net wrote:

[snip]
我创建了一个文档类型为XHTML 1.0 Strict的文档。
在检查语法时,我收到以下错误消息:

文档类型不允许元素< img>元素内容
"< body>"。


我希望你把IMG元素变成了BODY的孩子。严格(x)HTML

只允许块级和SCRIPT元素成为BODY

元素的子元素。


Move元素。完全取决于文档的结构。

在HTML 4.01 Transitional中这不是问题[...]
I''ve created a document with a doctype of XHTML 1.0 Strict.
When checking my syntax, I get the following error message:

Document type does not permit element "<img>" in content of element
"<body>".
I expect you''ve made the IMG element a child of BODY. Strict (x)HTML
only allows block-level and SCRIPT elements to be children of the BODY
element.

Move the element. Where exactly depends on how your document is structured.
In HTML 4.01 Transitional this isn''t a problem [...]




如果你考虑过HTML,为什么要使用XHTML?严格的HTML也一样好,而且暂时可能比Strict XHTML更好。


Mike


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



If you considered HTML, why use XHTML? Strict HTML is just as good, and
perhaps better for the time being, than Strict XHTML.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


fl ****** @ comcast.net 写道:
fl******@comcast.net wrote:
我刚刚开始进入XHTML,所以我的经验相当有限。我创建了一个文档类型为XHTML 1.0 Strict的文档。
在检查我的语法时,我收到以下错误消息:

文档类型不允许元素< img> ;"元素内容
"< body>"。


严格的HTML 4.01和Strich XHTML 1.0不允许文本级内容

(包括< img>)作为某些元素的直接子项

(例如body,blockquote和form)。你需要有一个中间的

图层块级元素。

在HTML 4.01 Transitional中,这不是问题,但它似乎是在XHTML中。
I''m just beginning to get into XHTML, so my experience is rather
limited. I''ve created a document with a doctype of XHTML 1.0 Strict.
When checking my syntax, I get the following error message:

Document type does not permit element "<img>" in content of element
"<body>".
Strict HTML 4.01 and Strich XHTML 1.0 do not allow text level content
(which includes <img>) as the immediate child of certain elements
(e.g. body, blockquote and form). You need to have an intermediate
layer block level element.
In HTML 4.01 Transitional this isn''t a problem, but it appears to be in
XHTML.




你陷入了一个共同陷阱。您已经从HTML Transitional

转移到XHTML Strict并假设您遇到的问题是

HTML / XHTML问题实际上它们是Transitional / Strict问题。


史蒂夫


-

我的理论给你,我的异端邪说愤怒的你,

我从不回信,你也不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



You''ve fallen into a common trap. You''ve moved from HTML Transitional
to XHTML Strict and assumed that the issues you''ve encountered are
HTML/XHTML issues when in fact they are Transitional/Strict issues.

Steve


--
"My theories appal you, my heresies outrage you,
I never answer letters and you don''t like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>


这篇关于XHTML中的图像标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆