各种DOCTYPE问题。 [英] Various DOCTYPE questions.

查看:62
本文介绍了各种DOCTYPE问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有点像网页编写的新手。我过去使用WYSIWYG软件在

制作了几个网站,但现在我对手动

脚本更感兴趣。我对DOCTYPE有一些疑问:


1.是doctype语句*必需*,还是只是强烈建议?我/ b $ b可能会使用Transitional doctype。


2.我理解在框架集中我必须使用Framset Doctype ststement,

但是框架集中的各个页面呢?我必须在这些页面中使用

Frameset Doctype语句吗?他们甚至会有一个

doctype,还是Frameset doctype足够?


3. doctype语句实际上*做*任何东西,或者是它只是一个

声明你遵守标准?


我问问题#3因为我的网站目前都没有DOCTYPE
语句,但插入DOCTYPE语句有时会搞砸页面的

格式。 DIV'不排队,边界并不总是正确的,

JavaScripts(我已下载)不会以同样的方式工作。另外,水平

滚动条显示在他们之前的位置。但是当我验证页面时,

验证器没有显示受影响的元素有什么问题。


例如:在我的个人主页中,我有一个< div>橙色点缀

边框,在一帧内排成一行。它按照我的意图很好地排列

它。但是当我插入< Transitional> doctype,div延伸到页面上,而且文本不合适。


所以我只是想知道它们有多重要。最终我想验证

我的所有页面并包含doctypes。万一有人感兴趣,这里

是我的两个网站。提前感谢您的回复。

http:// home。 comcast.net/~vikenk
http://www.sayatnova.com


-

Viken K.
http://home.comcast.net/~vikenk

解决方案

< blockquote>曾几何时* Viken Karaguesian *写道:

大家好,

我有点像webscripting的新手。我用WYSIWYG软件在过去制作了几个网站,但现在我对手动编写脚本更感兴趣。我对DOCTYPE有一些疑问:

1.是否需要* doctype语句*,或者只是强烈建议?我可能会使用Transitional doctype。


答:如果您希望页面验证,则需要* *即使没有

它也是强烈建议的 。


使用完整的doctype(带链接)

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"

" http://www.w3.org/TR/html4/loose.dtd">


2.我明白在框架集我必须使用Framset Doctype ststement,
但是框架集中的各个页面呢?我必须在这些页面中使用
Frameset Doctype语句吗?他们甚至会有一个
doctype,还是Frameset文档类型足够?


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Frameset // EN"

" http:// www。 w3.org/TR/html4/frameset.dtd">


仅在框架集文件中进行,过渡到所有其他单独的
页面。 />

3. doctype语句实际上*做*什么,或者它只是一个
声明你遵守标准吗?


是的,确实如此。它使得浏览器渲染页面时不会猜测它们应该是什么样的,当它们在标准模式下渲染时,

不是在Quirks模式下。

我问问题#3,因为我的网站目前都没有DOCTYPE
语句,但插入DOCTYPE语句有时会搞砸页面的格式。 DIV'不排队,边界并不总是正确的,
JavaScripts(我已下载)不会以同样的方式工作。此外,水平的滚动条显示在他们之前的地方。但是当我验证页面时,验证器并没有显示受影响的元素有什么问题。

例如:在我的个人主页上,我有一个< DIV>橙色点缀
边框,在一个框架内排成一行。它按照我的预期方式很好地排列。但是当我插入< Transitional> doctype,div延伸到页面上,文本不合适。

所以我只是想知道它们有多重要。最终我想验证我的所有页面并包含doctypes。如果有人有兴趣,这里
是我的两个网站。提前感谢您的回复。

http:// home。 comcast.net/~vikenk
http://www.sayatnova.com




您是否真的试图验证您的网页?您是否曾使用除IE之外的任何其他浏览器查看您的页面?b
?如果没有,你应该。 home.comcast.net/~vikenk的

首页在mozilla中看起来非常好,

而且'* *不是* Mozilla'的错:)


添加doctype声明然后验证
http://validator.w3.org/ (HTML)
http://jigsaw.w3.org/css-validator/ (CSS)


您的CSS中有几个严重错误。


-

/ Arne

现在杀死所有不报价的顶级海报和海报

*如何发布: http://www.cs.tut.fi /〜jkorpela/usenet/brox.html

*来自Google: http://www.safalra.com/special/googlegroupsreply/

------------------ --------------- ----------------------------


Viken Karaguesian写道:

1.是doctype语句*必需*,还是只是强烈建议?我可能会使用Transitional doctype。




新文档应该使用严格的doctype。 Transitional是针对旧遗留页面的轻微更新,您不想花时间去完成

工作,例如将表示代码移除到CSS样式表中。


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN"

" http://www.w3。 org / TR / html4 / strict.dtd">


请参阅:< http://www.w3.org/QA/2002/04/valid-dtd-list。 html>


此外,google为框架是邪恶的


-

-bts

-当摩托车,从不跟随猪车


>你真的试过验证你的网页吗?您是否曾使用除IE以外的任何其他浏览器查看

您的网页?如果没有,你应该。 home.comcast.net/~vikenk的首页在mozilla中看起来非常好,
而且*不是* Mozilla的错::)




是的,我有,而且他们不能很好地验证。 :>(我知道我的网页在Mozzila看起来如何
并且无法弄清楚为什么会这样。我是

不是很了解html,所以我正在努力深入了解

弄清楚为什么会这样。看起来在Opera中看起来很好,但有些是

颜色看起来有点偏。


Hello all,

I''m somewhat of a newbie to webscripting. I''ve made a couple of websites in
the past with WYSIWYG software, but now I''m much more interested in manual
scripting. I have some questions about DOCTYPE:

1. Is a doctype statement *required*, or is it just "strongly suggested"? I
would probably be using a Transitional doctype.

2. I understand that in a frameset I must use a Framset Doctype ststement,
but what about the individual pages within the frameset? Must I use the
Frameset Doctype statement in those pages as well? Would they even have a
doctype at all, or is the Frameset doctype enough?

3. Does a doctype statement actually *do* anything, or is it just a
declaration that you''re following a standard?

I ask question #3 because none of my websites currently have a DOCTYPE
statement, but inserting a DOCTYPE statement sometimes screws up the
formatting of the page. DIV''s don''t line up, borders aren''t always right,
JavaScripts (that I''ve downloaded) don''t work the same way. Also, horizontal
scroll bars show up where they weren''t before. But when I validate the page,
the validator doesn''t show anything wrong with the elements that are
affected.

For instance: In my personal homepage, I have a <div> with an orange dotted
border that''s lined up within a frame. It lines up nicely the way I intended
it. But when I insert the <Transitional> doctype, the div stretches across
the page and the text doesn''t fit right.

So I''m just wondering how important they are. Eventually I want to validate
all my pages and include doctypes. Just in case anyone is interested, here
are two of my sites. Thanks in advance for any replies.

http://home.comcast.net/~vikenk
http://www.sayatnova.com

--
Viken K.
http://home.comcast.net/~vikenk

解决方案

Once upon a time *Viken Karaguesian* wrote:

Hello all,

I''m somewhat of a newbie to webscripting. I''ve made a couple of websites in
the past with WYSIWYG software, but now I''m much more interested in manual
scripting. I have some questions about DOCTYPE:

1. Is a doctype statement *required*, or is it just "strongly suggested"? I
would probably be using a Transitional doctype.
A: It''s *required* if you want the page to validate, and even if not
it''s "strongly suggested".

Use a full doctype (with the link)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

2. I understand that in a frameset I must use a Framset Doctype ststement,
but what about the individual pages within the frameset? Must I use the
Frameset Doctype statement in those pages as well? Would they even have a
doctype at all, or is the Frameset doctype enough?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

Goes only in the frameset file, transitional to all other individual
pages.

3. Does a doctype statement actually *do* anything, or is it just a
declaration that you''re following a standard?
Yes, it does. It makes the browsers render the pages without guessing
what they should look like, when rendering them in Standard Mode and
not in Quirks Mode.

I ask question #3 because none of my websites currently have a DOCTYPE
statement, but inserting a DOCTYPE statement sometimes screws up the
formatting of the page. DIV''s don''t line up, borders aren''t always right,
JavaScripts (that I''ve downloaded) don''t work the same way. Also, horizontal
scroll bars show up where they weren''t before. But when I validate the page,
the validator doesn''t show anything wrong with the elements that are
affected.

For instance: In my personal homepage, I have a <div> with an orange dotted
border that''s lined up within a frame. It lines up nicely the way I intended
it. But when I insert the <Transitional> doctype, the div stretches across
the page and the text doesn''t fit right.

So I''m just wondering how important they are. Eventually I want to validate
all my pages and include doctypes. Just in case anyone is interested, here
are two of my sites. Thanks in advance for any replies.

http://home.comcast.net/~vikenk
http://www.sayatnova.com



Have you really tried to validate your pages? Have you ever looked on
your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that''s *not* Mozilla''s fault :)

Add the doctype declarations and then validate on
http://validator.w3.org/ (HTML)
http://jigsaw.w3.org/css-validator/ (CSS)

You have several serious errors in your CSS.

--
/Arne
Now killing all top posters and posters who don''t quote
* How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
* From Google: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------


Viken Karaguesian wrote:

1. Is a doctype statement *required*, or is it just "strongly
suggested"? I would probably be using a Transitional doctype.



New documents should use a Strict doctype. Transitional is for minor
updates to old legacy pages where you don''t want to take the time to do
work such as remove presentational code into a CSS stylesheet.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

See: <http://www.w3.org/QA/2002/04/valid-dtd-list.html>

Also, google for "frames are evil"

--
-bts
-When motorcycling, never follow a pig truck


> Have you really tried to validate your pages? Have you ever looked on

your pages with any other browser than IE? If not, you should. The
front page for home.comcast.net/~vikenk looks very emty in mozilla,
and that''s *not* Mozilla''s fault :)



Yes, I have, and they don''t validate well. :>( I know how my webpage looks
in Mozzila and have not been able to figure out why it looks like that. I''m
not very knowledgeable about html, so I''m trying to get more in depth to
figure out why it''s that way. It seems to look fine in Opera, but some of
the colors seem a bit off.


这篇关于各种DOCTYPE问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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