<身体GT;< /体>是无效的html 4严格? [英] <body></body> is invalid html 4 strict?

查看:62
本文介绍了<身体GT;< /体>是无效的html 4严格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个无效的html 4严格文件的有趣案例。


总之,如果你有< body>< / bodywithout任何内容,那么文件

在html 4 strict下无效。如果html 4丢失则有效。


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" http://www.w3.org/

TR / html4 / strict.dtd">

< html>

< head>

< META HTTP-EQUIV =" Content-Type" CONTENT =" text / html; charset = utf-8">

< title>< / title>

< / head>

< body>

< / body>

< / html>


Xah
a ?? http://xahlee.org/

a? ?

解决方案

2008年6月21日星期六04:25:02 -0700(PDT),/ Xah /:


这是一个有趣的无效html 4严格文件的案例。


总之,如果你有< body>< / bodywithout任何内容,文件

在html 4 strict下无效。如果html 4输了则有效。



是的,根据Strict

< http://www.w3.org/TR/html401/sgml这是正确的/dtd.html>:


<! - ===================文件正文== ================================== - >


<!ELEMENT BODY OO(%block; | SCRIPT)+ +(INS | DEL) - 文件正文 - >



和Transitional< http://www.w3.org/TR/html401/sgml/loosedtd.html>:


<! - ===================文件正文================= =================== - >


<!ELEMENT BODY OO(%flow;)* +(INS | DEL) - 文件正文 - >



文件类型定义。


-

Stanimir


On Sat,2008年6月21日04:25:02 -0700(PDT),Xah写道:


<!DOCTYPE HTML PUBLIC " - // W3C // DTD HTML 4.01 // EN" http://www.w3.org/

TR / html4 / strict.dtd">

< html>

< head>

< META HTTP-EQUIV =" Content-Type" CONTENT =" text / html; charset = utf-8">

< title>< / title>

< / head>

< body>

< / body>

< / html>



你好Xah。要验证它,你必须在

< title>< / title>中加入一些东西。


希望你很好,

Ian

-

最好是懒散和丢失而不是b / b
根本没有闲逛。 (James Thurber)
http://rastallian.blogspot.com/


Scripsit Lance Manyon:


为了验证它,你必须把东西放在

< title>< / title>。



不,你不是。 (当然,含有空内容的标题元素是一个糟糕的想法,但这与验证无关。)


下次,考虑到在发布之前最少测试你的建议。

(任何能阅读DTD并因此提供有关

验证的明智建议的人当然可以立即看到你的建议是错误的。)


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/


Here''s a interesting case of invalid html 4 strict file.

In summary, if you have <body></bodywithout any content, the file
would be invalid under html 4 strict. Valid if html 4 lose.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8">
<title></title>
</head>
<body>
</body>
</html>

Xah
a?? http://xahlee.org/

a??

解决方案

Sat, 21 Jun 2008 04:25:02 -0700 (PDT), /Xah/:

Here''s a interesting case of invalid html 4 strict file.

In summary, if you have <body></bodywithout any content, the file
would be invalid under html 4 strict. Valid if html 4 lose.

Yes, it is correct according to the Strict
<http://www.w3.org/TR/html401/sgml/dtd.html>:

<!--=================== Document Body ====================================-->

<!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->

and Transitional <http://www.w3.org/TR/html401/sgml/loosedtd.html>:

<!--=================== Document Body ====================================-->

<!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->

document type definitions.

--
Stanimir


On Sat, 21 Jun 2008 04:25:02 -0700 (PDT), Xah wrote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=utf-8">
<title></title>
</head>
<body>
</body>
</html>

Hi Xah. For it to validate, you have to put something in the
<title></title>.

Hope you''re well,
Ian
--
It is better to have loafed and lost than
never to have loafed at all. (James Thurber)
http://rastallian.blogspot.com/


Scripsit Lance Manyon:

For it to validate, you have to put something in the
<title></title>.

No you don''t. (Of course, a title element with empty content is a bad
idea, but that has nothing to do with validation.)

Next time, considering at least testing your advice before posting it.
(Anyone who can read DTDs and therefore give informed advice on
validation can immediately see that your advice is wrong, of course.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


这篇关于&LT;身体GT;&LT; /体&GT;是无效的html 4严格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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