W3C验证器错误? < br />适用于doctype HTML 4.01 Strict [英] W3C Validator error? <br /> is valid for doctype HTML 4.01 Strict

查看:50
本文介绍了W3C验证器错误? < br />适用于doctype HTML 4.01 Strict的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


W3C HTML Validator [1]在返回< br />时出错了有效

for HTML 4.01 Strict doctype?


2004年3月[2],Validator返回< br />,< hr /> ;和< img />

对HTML 4.01严格无效。


Liam Quinn说[2]你不能混合HTML和XHTML。您需要选择

一种或另一种语法。

[含义:选择< br>用于HTML和< br />对于XHTML]


至于今天,Validator返回< br />和< img />适用于

HTML 4.01严格,但< hr /> (以及< meta />和< link />)

无效。


似乎Validator已改变其行为2004年。


[1] http://验证员。 w3.org/

[2] http://lists.w3.org/Archives/Public/...r/2003Mar/0028

Liam Quinn是WDG的创始成员( Wed Desing Group)。


谢谢,

Thomas Jedenfelt

轮胎? (斯德哥尔摩),瑞典

Hi everyone,

Is the W3C HTML Validator [1] in error when it returns <br /> as valid
for HTML 4.01 Strict doctype?

In March 2004 [2], the Validator returned <br />, <hr /> and <img />
as invalid for HTML 4.01 Strict.

Liam Quinn said [2] "You can''t mix HTML and XHTML. You need to choose
one or the other syntax."
[meaning: choose <br> for HTML and <br /> for XHTML]

As for today, the Validator returns <br /> and <img /> as valid for
HTML 4.01 Strict, but <hr /> (and also <meta /> and <link />)
as invalid.

It seems that the Validator has changed its behaviour since 2004.

[1] http://validator.w3.org/
[2] http://lists.w3.org/Archives/Public/...r/2003Mar/0028
Liam Quinn is a founding member of WDG (Wed Desing Group).

Thanks,
Thomas Jedenfelt
Tyres? (Stockholm), Sweden

推荐答案

th **************** @ operamail.com 写道:
th****************@operamail.com wrote:
是W3C HTML验证器[1]返回< br />时出错因为
对HTML 4.01严格的doctype有效吗?


否,因为< br />是有效的(相当于< br>>)。

2004年3月[2],Validator返回< br />,< hr />和< img
/>对于HTML 4.01严格无效。


不,你误解了 - 这是可以理解的,因为声明

的制定不是很清楚。


< br />的原因是有效的,无论在哪里< br>允许,它可能跟随字符数据,因此< br>>也有效。但是< hr />在HTML 4.01 Strict中经常不允许使用
。如果您有

< body>

< hr>>

< / body>

然后< hr>没问题(hr是块级元素)但是>不是。


有关详细说明,请参阅
http://www.cs.tut.fi/~jkorpela/html/empty.html

似乎Validator有自2004年以来改变了它的行为。
Is the W3C HTML Validator [1] in error when it returns <br /> as
valid for HTML 4.01 Strict doctype?
No, because <br /> is valid (and equivalent to <br >>).
In March 2004 [2], the Validator returned <br />, <hr /> and <img
/> as invalid for HTML 4.01 Strict.
No, you misunderstood - which is understandable, since the statement
was not very clearly formulated.

The reason why <br /> is valid is that wherever <br> is allowed, it may
be followed by character data, so <br>> is valid too. But <hr /> is
often not allowed in HTML 4.01 Strict. If you have
<body>
<hr>>
</body>
then <hr> is OK (hr is a block level element) but > is not.

For a detailed explanation, see
http://www.cs.tut.fi/~jkorpela/html/empty.html
It seems that the Validator has changed its behaviour since 2004.




不是这方面的;关于它的行为的报告很模糊。


-

Yucca, http://www.cs.tut.fi/~jkorpela/

关于网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html



Not in this respect; the report about its behaviour was just vague.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


th **************** @ operamail.com 写道:
th****************@operamail.com wrote:
是W3C HTML验证器[1]返回时错误< br /> HTML 4.01严格doctype的有效



不,这是有效的。在HTML< br />中是< br>>的简称(而在XHTML中它是

是< br>< / br>)的缩写。幸运的是(从XHTML

bacwards compatability的角度来看)几乎没有任何浏览器能够正确识别HTML,所以它被视为< br>



2004年3月[2],Validator返回< br />,< hr />和< img />
对HTML 4.01 Strict无效。


取决于您使用它们的位置。因为它们相当于< br>>,< hr>>和

< img>>你不能在文本(即>)无效的情况下使用它们

(虽然这也会排除< img>)。

Liam Quinn说[2] ]你不能混用HTML和XHTML。您需要选择
一种或另一种语法。
[含义:选择< br>用于HTML和< br />对于XHTML]


好​​的,正确的,建议。

至于今天,Validator返回< br />和< img />对于
HTML 4.01严格有效,但< hr /> (以及< meta />和< link />)
无效。


大概你正在使用< br /> < img />在允许文本为/ b $ b的地方,因此>已验证。但是< hr />在一个不允许使用

文本的地方,因此>是一个错误。作为< meta>和< link>

只能放在头部,不允许文字你必须使用

HTML表格。

似乎自2004年以来,Validator已经改变了它的行为。
Is the W3C HTML Validator [1] in error when it returns <br /> as valid
for HTML 4.01 Strict doctype?
No. It''s valid. In HTML <br/> is short for <br>> (whereas in XHTML it
is short for <br></br>). Fortunately (from the point of view of XHTML
bacwards compatability) virtually no browser gets HTML right so it''s
treated as <br>.
In March 2004 [2], the Validator returned <br />, <hr /> and <img />
as invalid for HTML 4.01 Strict.
Depends where you use them. As they are equivalent to <br>>, <hr>> and
<img>> you can not use them where text (i.e. the >) would be invalid
(though that would also rule out <img>).
Liam Quinn said [2] "You can''t mix HTML and XHTML. You need to choose
one or the other syntax."
[meaning: choose <br> for HTML and <br /> for XHTML]
Good, and correct, advice.
As for today, the Validator returns <br /> and <img /> as valid for
HTML 4.01 Strict, but <hr /> (and also <meta /> and <link />)
as invalid.
Presumably you''re using <br /> an <img /> in places where text is
allowed and hence the > is valid. But the <hr/> is in a place where
text is not allowed and hence then > is an error. As <meta> and <link>
can only go in the head, where text is not allowed you must use the
HTML form.
It seems that the Validator has changed its behaviour since 2004.




您是否问过W3C Validator团队?


Steve


-

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

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


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



Have you asked the W3C Validator team?

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/>


th **************** @ operamail.com 写道:
2004年3月[2] ,Validator返回< br /> ;,< hr />并且< img />
对HTML 4.01严格无效。

Liam Quinn说[2]你不能混用HTML和XHTML。您需要选择
一种或另一种语法。
[含义:选择< br>用于HTML和< br />对于XHTML]

至于今天,Validator返回< br />和< img />对于
HTML 4.01严格有效,但< hr /> (以及< meta />和< link />)
无效。

自2004年以来,Validator似乎已经改变了它的行为。
In March 2004 [2], the Validator returned <br />, <hr /> and <img />
as invalid for HTML 4.01 Strict.

Liam Quinn said [2] "You can''t mix HTML and XHTML. You need to choose
one or the other syntax."
[meaning: choose <br> for HTML and <br /> for XHTML]

As for today, the Validator returns <br /> and <img /> as valid for
HTML 4.01 Strict, but <hr /> (and also <meta /> and <link />)
as invalid.

It seems that the Validator has changed its behaviour since 2004.




在HTML 4.01中,< br />相当于< br>>。它并非无效,只是

与你的意思不同。 < meta />和< link />是无效的,因为

第二个大于标志结束了HEAD部分(任何字符数据

会),你可能还没有完成它。 < hr />是无效的

因为块级内容(HR元素本身)被允许为

a严格的BODY元素的直接子元素,字符数据(

大于号码)不是。


我不知道为什么你以前试过的结果会有所不同。

你确定它是同一个文件吗?



In HTML 4.01, <br /> is equivalent to <br>>. It''s not invalid, just
different from what you mean. <meta /> and <link /> are invalid because
the second greater-than sign ends the HEAD section (any character data
would), and you presumably haven''t completed it yet. <hr /> is invalid
because while block-level content (the HR element itself) is allowed as
a direct child of the BODY element in Strict, character data (the
greater-than sign) isn''t.

I''m not sure why the results were different when you previously tried.
Are you sure it was the same document?


这篇关于W3C验证器错误? &lt; br /&gt;适用于doctype HTML 4.01 Strict的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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